Skip to content

fix assert_is_empty clippy lint #14917

Description

@xtqqczze
$ cargo clippy -q --workspace --all-targets --all-features
warning: used `assert!` to check that a value is not empty
  --> src/uucore/src/lib/features/encoding.rs:47:9
   |
47 |         assert!(!alphabet.is_empty());
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/index.html#assert_is_empty
   = note: `-W clippy::assert-is-empty` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::assert_is_empty)]`
help: use `assert_ne!` to show the value on failure
   |
47 -         assert!(!alphabet.is_empty());
47 +         assert_ne!(alphabet, []);
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions