Skip to content

cargo clippy complains #6

@szabgab

Description

@szabgab

Using

$ rustc -vV
rustc 1.93.1 (01f6ddf75 2026-02-11)
binary: rustc
commit-hash: 01f6ddf7588f42ae2d7eb0a2f21d44e8e96674cf
commit-date: 2026-02-11
host: x86_64-unknown-linux-gnu
release: 1.93.1
LLVM version: 21.1.8

Clippy complains.

$ cargo clippy
warning: no edition set: defaulting to the 2015 edition while the latest is 2024
    Checking thousands v0.2.1-alpha.0 (/home/gabor/github/rust/thousands-rs)
warning: this expression creates a reference which is immediately dereferenced by the compiler
 --> src/display.rs:8:56
  |
8 |         let (before, number, after, count) = find_span(&self, |c| policy.digits.contains(&c));
  |                                                        ^^^^^ help: change this to: `self`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#needless_borrow
  = note: `#[warn(clippy::needless_borrow)]` on by default

warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
  --> src/helpers.rs:18:39
   |
18 |         for (index, &group) in groups.into_iter().enumerate() {
   |                                       ^^^^^^^^^ help: call directly: `iter`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#into_iter_on_ref
   = note: `#[warn(clippy::into_iter_on_ref)]` on by default

warning: unneeded `return` statement
  --> src/helpers.rs:83:9
   |
83 |         return Some(true);
   |         ^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#needless_return
   = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
   |
83 -         return Some(true);
83 +         Some(true)
   |

warning: `thousands` (lib) generated 3 warnings (run `cargo clippy --fix --lib -p thousands` to apply 3 suggestions)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.18s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions