Skip to content

Commit

Permalink
Resolve ignored_unit_patterns pedantic clippy lint
Browse files Browse the repository at this point in the history
    warning: matching over `()` is more explicit
       --> src/ser.rs:295:72
        |
    295 |             (_, false, false) => write!($this.dst, "{}", $v).and_then(|_| {
        |                                                                        ^ help: use `()` instead of `_`: `()`
    ...
    360 |         serialize_float!(self, v)
        |         ------------------------- in this macro invocation
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
        = note: `-W clippy::ignored-unit-patterns` implied by `-W clippy::pedantic`
        = note: this warning originates in the macro `serialize_float` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: matching over `()` is more explicit
       --> src/ser.rs:295:72
        |
    295 |             (_, false, false) => write!($this.dst, "{}", $v).and_then(|_| {
        |                                                                        ^ help: use `()` instead of `_`: `()`
    ...
    364 |         serialize_float!(self, v)
        |         ------------------------- in this macro invocation
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
        = note: this warning originates in the macro `serialize_float` (in Nightly builds, run with -Z macro-backtrace for more info)
  • Loading branch information
dtolnay committed Aug 12, 2023
1 parent 090b32d commit 69cd3f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ macro_rules! serialize_float {
(false, true, _) => write!($this.dst, "nan"),
(true, false, true) => write!($this.dst, "-0.0"),
(false, false, true) => write!($this.dst, "0.0"),
(_, false, false) => write!($this.dst, "{}", $v).and_then(|_| {
(_, false, false) => write!($this.dst, "{}", $v).and_then(|()| {
if $v % 1.0 == 0.0 {
write!($this.dst, ".0")
} else {
Expand Down

0 comments on commit 69cd3f1

Please sign in to comment.