A explorer: Clippy pour coder plus proprement
Il existe la commande cargo clippy
qui peux t'aider a mieux programmer!
warning: single-character string constant used as pattern
--> src/main.rs:556:45
|
556 | let split = chaine.trim().split(" ");
| ^^^ help: try using a `char` instead: `' '`
|
= note: `#[warn(clippy::single_char_pattern)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
warning: equality checks against false can be replaced by a negation
--> src/main.rs:565:24
|
565 | if fs::metadata("data.txt").is_ok() == false {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `!fs::metadata("data.txt").is_ok()`
|
= note: `#[warn(clippy::bool_comparison)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison
warning: equality checks against false can be replaced by a negation
--> src/main.rs:576:24
|
576 | if fs::metadata("data.txt").is_ok() == false {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try simplifying it as shown: `!fs::metadata("data.txt").is_ok()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison
warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices
--> src/main.rs:600:25
|
600 | fn voir(_l: &Vec<Piece>, _liste_professeur: &Vec<Professeur>, p_courante: i8) {
| ^^^^^^^^^^^ help: change this to: `&[Piece]`
|
= note: `#[warn(clippy::ptr_arg)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices
--> src/main.rs:600:57
|
600 | fn voir(_l: &Vec<Piece>, _liste_professeur: &Vec<Professeur>, p_courante: i8) {
| ^^^^^^^^^^^^^^^^ help: change this to: `&[Professeur]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices
--> src/main.rs:610:21
|
610 | _l: &Vec<Piece>,
| ^^^^^^^^^^^ help: change this to: `&[Piece]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices
--> src/main.rs:611:36
|
611 | _liste_professeur: &Vec<Professeur>,
| ^^^^^^^^^^^^^^^^ help: change this to: `&[Professeur]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices
--> src/main.rs:613:29
|
613 | _liste_qcm: &Vec<Qcm>,
| ^^^^^^^^^ help: change this to: `&[Qcm]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
warning: manual implementation of an assign operation
--> src/main.rs:638:53
|
638 | ... SCORE = SCORE + 1;
| ^^^^^^^^^^^^^^^^^ help: replace it with: `SCORE += 1`
|
= note: `#[warn(clippy::assign_op_pattern)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
warning: manual implementation of an assign operation
--> src/main.rs:643:53
|
643 | ... SCORE = SCORE - 1;
| ^^^^^^^^^^^^^^^^^ help: replace it with: `SCORE -= 1`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
warning: manual implementation of an assign operation
--> src/main.rs:653:53
|
653 | ... SCORE = SCORE + 1;
| ^^^^^^^^^^^^^^^^^ help: replace it with: `SCORE += 1`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
warning: manual implementation of an assign operation
--> src/main.rs:658:53
|
658 | ... SCORE = SCORE - 1;
| ^^^^^^^^^^^^^^^^^ help: replace it with: `SCORE -= 1`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
warning: manual implementation of an assign operation
--> src/main.rs:666:53
|
666 | ... SCORE = SCORE + 1;
| ^^^^^^^^^^^^^^^^^ help: replace it with: `SCORE += 1`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
warning: manual implementation of an assign operation
--> src/main.rs:671:53
|
671 | ... SCORE = SCORE - 1;
| ^^^^^^^^^^^^^^^^^ help: replace it with: `SCORE -= 1`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices
--> src/main.rs:692:67
|
692 | fn aller(vec: Vec<&str>, mut _piece_courante: i8, _l: &Vec<Piece>, mut p_courante: i8) {
| ^^^^^^^^^^^ help: change this to: `&[Piece]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices
--> src/main.rs:770:35
|
770 | fn afficher_piece(_l: &Vec<Piece>, piece_courante: i8) {
| ^^^^^^^^^^^ help: change this to: `&[Piece]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
warning: `zuul` (bin "zuul") generated 16 warnings