Skip to content

Version 3.1.0

Version 3.1.0 #80

GitHub Actions / lint succeeded Jul 25, 2024 in 0s

lint

12 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 12
Note 0
Help 0

Versions

  • rustc 1.80.0 (051478957 2024-07-21)
  • cargo 1.80.0 (376290515 2024-07-16)
  • clippy 0.1.80 (0514789 2024-07-21)

Annotations

Check warning on line 280 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / lint

usage of a legacy numeric method

warning: usage of a legacy numeric method
   --> src/lib.rs:280:42
    |
280 |         assert_eq!(entropy.guesses, u64::max_value());
    |                                          ^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
    |
280 |         assert_eq!(entropy.guesses, u64::MAX);
    |                                          ~~~

Check warning on line 1169 in src/scoring.rs

See this annotation in the file changed.

@github-actions github-actions / lint

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
    --> src/scoring.rs:1169:42
     |
1169 |         let value = serde_json::to_value(&score).unwrap();
     |                                          ^^^^^^ help: change this to: `score`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
     = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 971 in src/scoring.rs

See this annotation in the file changed.

@github-actions github-actions / lint

casting to the same type is unnecessary (`u64` -> `u64`)

warning: casting to the same type is unnecessary (`u64` -> `u64`)
   --> src/scoring.rs:969:31
    |
969 |   ...                   * (*scoring::KEYBOARD_STARTING_POSITIONS
    |  _________________________^
970 | | ...                       * scoring::KEYBOARD_AVERAGE_DEGREE.pow(j as u32))
971 | | ...                       as u64
    | |________________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
help: try
    |
969 ~                             * (*scoring::KEYBOARD_STARTING_POSITIONS
970 +                                 * scoring::KEYBOARD_AVERAGE_DEGREE.pow(j as u32))
    |

Check warning on line 952 in src/scoring.rs

See this annotation in the file changed.

@github-actions github-actions / lint

casting to the same type is unnecessary (`u64` -> `u64`)

warning: casting to the same type is unnecessary (`u64` -> `u64`)
   --> src/scoring.rs:952:39
    |
952 |         assert_eq!(p.estimate(token), base_guesses as u64);
    |                                       ^^^^^^^^^^^^^^^^^^^ help: try: `{ base_guesses }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check warning on line 920 in src/scoring.rs

See this annotation in the file changed.

@github-actions github-actions / lint

casting to the same type is unnecessary (`u64` -> `u64`)

warning: casting to the same type is unnecessary (`u64` -> `u64`)
   --> src/scoring.rs:920:39
    |
920 |         assert_eq!(p.estimate(token), base_guesses as u64);
    |                                       ^^^^^^^^^^^^^^^^^^^ help: try: `{ base_guesses }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    = note: `#[warn(clippy::unnecessary_cast)]` on by default

Check warning on line 892 in src/scoring.rs

See this annotation in the file changed.

@github-actions github-actions / lint

casting the result of `i32::abs()` to u64

warning: casting the result of `i32::abs()` to u64
   --> src/scoring.rs:892:19
    |
892 |             365 * (*scoring::REFERENCE_YEAR - p.year).abs() as u64
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(*scoring::REFERENCE_YEAR - p.year).unsigned_abs()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned

Check warning on line 857 in src/scoring.rs

See this annotation in the file changed.

@github-actions github-actions / lint

casting the result of `i32::abs()` to u64

warning: casting the result of `i32::abs()` to u64
   --> src/scoring.rs:857:13
    |
857 |             (*scoring::REFERENCE_YEAR - 1972).abs() as u64
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(*scoring::REFERENCE_YEAR - 1972).unsigned_abs()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned
    = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default

Check warning on line 564 in src/scoring.rs

See this annotation in the file changed.

@github-actions github-actions / lint

manual `RangeInclusive::contains` implementation

warning: manual `RangeInclusive::contains` implementation
   --> src/scoring.rs:564:16
    |
564 |             if n >= 63 && n <= 100 {
    |                ^^^^^^^^^^^^^^^^^^^ help: use: `(63..=100).contains(&n)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
    = note: `#[warn(clippy::manual_range_contains)]` on by default

Check warning on line 1211 in src/matching/mod.rs

See this annotation in the file changed.

@github-actions github-actions / lint

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/matching/mod.rs:1211:9
     |
1211 |         assert_eq!(p.ascending, false);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
1211 -         assert_eq!(p.ascending, false);
1211 +         assert!(!p.ascending);
     |

Check warning on line 1085 in src/matching/mod.rs

See this annotation in the file changed.

@github-actions github-actions / lint

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/matching/mod.rs:1085:13
     |
1085 |             assert_eq!(p.l33t, true);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
1085 -             assert_eq!(p.l33t, true);
1085 +             assert!(p.l33t);
     |

Check warning on line 1066 in src/matching/mod.rs

See this annotation in the file changed.

@github-actions github-actions / lint

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/matching/mod.rs:1066:13
     |
1066 |             assert_eq!(p.l33t, true);
     |             ^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
1066 -             assert_eq!(p.l33t, true);
1066 +             assert!(p.l33t);
     |

Check warning on line 993 in src/matching/mod.rs

See this annotation in the file changed.

@github-actions github-actions / lint

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
   --> src/matching/mod.rs:993:13
    |
993 |             assert_eq!(p.reversed, true);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
    = note: `#[warn(clippy::bool_assert_comparison)]` on by default
help: replace it with `assert!(..)`
    |
993 -             assert_eq!(p.reversed, true);
993 +             assert!(p.reversed);
    |