Skip to content

Implement unsafe get_unchecked #30

Implement unsafe get_unchecked

Implement unsafe get_unchecked #30

GitHub Actions / clippy succeeded May 31, 2024 in 0s

clippy

17 warnings

Details

Results

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

Versions

  • rustc 1.78.0 (9b00956e5 2024-04-29)
  • cargo 1.78.0 (54d8815d0 2024-03-26)
  • clippy 0.1.78 (9b00956 2024-04-29)

Annotations

Check warning on line 2644 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `vec!`

warning: useless use of `vec!`
    --> src/lib.rs:2644:21
     |
2644 |         let bools = vec![true, false, true, true];
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[true, false, true, true]`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec

Check warning on line 2162 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `vec!`

warning: useless use of `vec!`
    --> src/lib.rs:2162:21
     |
2162 |         let bools = vec![true, false, true, true];
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[true, false, true, true]`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
     = note: `#[warn(clippy::useless_vec)]` on by default

Check warning on line 2817 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting integer literal to `u64` is unnecessary

warning: casting integer literal to `u64` is unnecessary
    --> src/lib.rs:2817:24
     |
2817 |             assert_eq!(0 as u64, tbits.count_zeros());
     |                        ^^^^^^^^ help: try: `0_u64`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check warning on line 2799 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting integer literal to `u64` is unnecessary

warning: casting integer literal to `u64` is unnecessary
    --> src/lib.rs:2799:24
     |
2799 |             assert_eq!(0 as u64, f.count_ones());
     |                        ^^^^^^^^ help: try: `0_u64`
     |
     = 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 2457 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2457:9
     |
2457 |         assert_eq!(s[5 * U32_BITS + 2], true);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
2457 -         assert_eq!(s[5 * U32_BITS + 2], true);
2457 +         assert!(s[5 * U32_BITS + 2]);
     |

Check warning on line 2456 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2456:9
     |
2456 |         assert_eq!(s[5 * U32_BITS + 1], false);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
2456 -         assert_eq!(s[5 * U32_BITS + 1], false);
2456 +         assert!(!s[5 * U32_BITS + 1]);
     |

Check warning on line 2455 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

warning: this operation has no effect
    --> src/lib.rs:2455:22
     |
2455 |         assert_eq!(s[5 * U32_BITS - 0], true);
     |                      ^^^^^^^^^^^^^^^^ help: consider reducing it to: `5 * U32_BITS`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
     = note: `#[warn(clippy::identity_op)]` on by default

Check warning on line 2455 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2455:9
     |
2455 |         assert_eq!(s[5 * U32_BITS - 0], true);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
2455 -         assert_eq!(s[5 * U32_BITS - 0], true);
2455 +         assert!(s[5 * U32_BITS - 0]);
     |

Check warning on line 2454 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2454:9
     |
2454 |         assert_eq!(s[5 * U32_BITS - 1], true);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
2454 -         assert_eq!(s[5 * U32_BITS - 1], true);
2454 +         assert!(s[5 * U32_BITS - 1]);
     |

Check warning on line 2405 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2405:9
     |
2405 |         assert_eq!(s[5 * U32_BITS + 1], false);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
2405 -         assert_eq!(s[5 * U32_BITS + 1], false);
2405 +         assert!(!s[5 * U32_BITS + 1]);
     |

Check warning on line 2403 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2403:9
     |
2403 |         assert_eq!(s[5 * U32_BITS], false);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
2403 -         assert_eq!(s[5 * U32_BITS], false);
2403 +         assert!(!s[5 * U32_BITS]);
     |

Check warning on line 2400 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2400:9
     |
2400 |         assert_eq!(s[5 * U32_BITS - 1], true);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
2400 -         assert_eq!(s[5 * U32_BITS - 1], true);
2400 +         assert!(s[5 * U32_BITS - 1]);
     |

Check warning on line 2399 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2399:9
     |
2399 |         assert_eq!(s[5 * U32_BITS - 2], true);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
     |
2399 -         assert_eq!(s[5 * U32_BITS - 2], true);
2399 +         assert!(s[5 * U32_BITS - 2]);
     |

Check warning on line 2396 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `assert_eq!` with a literal bool

warning: used `assert_eq!` with a literal bool
    --> src/lib.rs:2396:9
     |
2396 |         assert_eq!(s[5 * U32_BITS - 3], false);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = 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!(..)`
     |
2396 -         assert_eq!(s[5 * U32_BITS - 3], false);
2396 +         assert!(!s[5 * U32_BITS - 3]);
     |

Check warning on line 2756 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this is a decimal constant

warning: this is a decimal constant
    --> src/lib.rs:2756:34
     |
2756 |         assert_eq!(&[01, 00, 02, 03][..], &*a.to_bytes());
     |                                  ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
     |
2756 |         assert_eq!(&[01, 00, 02, 3][..], &*a.to_bytes());
     |                                  ~
help: if you mean to use an octal constant, use `0o`
     |
2756 |         assert_eq!(&[01, 00, 02, 0o3][..], &*a.to_bytes());
     |                                  ~~~

Check warning on line 2756 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this is a decimal constant

warning: this is a decimal constant
    --> src/lib.rs:2756:30
     |
2756 |         assert_eq!(&[01, 00, 02, 03][..], &*a.to_bytes());
     |                              ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
     |
2756 |         assert_eq!(&[01, 00, 2, 03][..], &*a.to_bytes());
     |                              ~
help: if you mean to use an octal constant, use `0o`
     |
2756 |         assert_eq!(&[01, 00, 0o2, 03][..], &*a.to_bytes());
     |                              ~~~

Check warning on line 2756 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this is a decimal constant

warning: this is a decimal constant
    --> src/lib.rs:2756:22
     |
2756 |         assert_eq!(&[01, 00, 02, 03][..], &*a.to_bytes());
     |                      ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal
     = note: `#[warn(clippy::zero_prefixed_literal)]` on by default
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
     |
2756 |         assert_eq!(&[1, 00, 02, 03][..], &*a.to_bytes());
     |                      ~
help: if you mean to use an octal constant, use `0o`
     |
2756 |         assert_eq!(&[0o1, 00, 02, 03][..], &*a.to_bytes());
     |                      ~~~