mgunyho / tere

Terminal file explorer
European Union Public License 1.2
1.67k stars 36 forks source link

Rustc warning: unnecessary parentheses around match arm expression #68

Closed frazar closed 1 year ago

frazar commented 1 year ago
> cargo build
   Compiling tere v1.2.0 (/home/frazar/gitprojects/tere)
warning: unnecessary parentheses around match arm expression
   --> src/ui/help_window.rs:190:23
    |
190 |             (_, _) => (c1.to_string().cmp(&c2.to_string())),
    |                       ^                                   ^
    |
    = note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
    |
190 -             (_, _) => (c1.to_string().cmp(&c2.to_string())),
190 +             (_, _) => c1.to_string().cmp(&c2.to_string()),
    |

warning: `tere` (bin "tere") generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 1.42s
mgunyho commented 1 year ago

Interesting, I don't see this warning, although I have a pretty old rustc (1.59). Which version do you have?

frazar commented 1 year ago

Here are the cargo and rustc versions I was using:

$ cargo -V
cargo 1.64.0 (387270bc7 2022-09-16)
$ rustc -V
rustc 1.64.0 (a55dd71d5 2022-09-19)
mgunyho commented 1 year ago

Yep, that explains it, after updating cargo & rustc I get the warning as well.