| RS.CLIPPY.ABSOLUTE_PATHS
|
Rust Clippy Lints |
checks for usage of an item without a `use` statement |
3 |
False |
| RS.CLIPPY.ABSURD_EXTREME_COMPARISONS
|
Rust Clippy Lints |
a comparison with a maximum or minimum value that is always true or false |
3 |
False |
| RS.CLIPPY.ALLOC_INSTEAD_OF_CORE
|
Rust Clippy Lints |
type is imported from alloc when available in core |
3 |
False |
| RS.CLIPPY.ALLOW_ATTRIBUTES
|
Rust Clippy Lints |
`#[allow]` will not trigger if a warning isn't found. `#[expect]` triggers if there are no warnings. |
3 |
False |
| RS.CLIPPY.ALLOW_ATTRIBUTES_WITHOUT_REASON
|
Rust Clippy Lints |
ensures that all `allow` and `expect` attributes have a reason |
3 |
False |
| RS.CLIPPY.ALMOST_COMPLETE_RANGE
|
Rust Clippy Lints |
almost complete range |
3 |
False |
| RS.CLIPPY.ALMOST_SWAPPED
|
Rust Clippy Lints |
`foo = bar; bar = foo` sequence |
3 |
False |
| RS.CLIPPY.APPROX_CONSTANT
|
Rust Clippy Lints |
the approximate of a known float constant (in `std::fXX::consts`) |
3 |
False |
| RS.CLIPPY.ARBITRARY_SOURCE_ITEM_ORDERING
|
Rust Clippy Lints |
arbitrary source item ordering |
3 |
False |
| RS.CLIPPY.ARC_WITH_NON_SEND_SYNC
|
Rust Clippy Lints |
using `Arc` with a type that does not implement `Send` and `Sync` |
3 |
False |
| RS.CLIPPY.ARITHMETIC_SIDE_EFFECTS
|
Rust Clippy Lints |
any arithmetic expression that can cause side effects like overflows or panics |
3 |
False |
| RS.CLIPPY.ASSERTIONS_ON_CONSTANTS
|
Rust Clippy Lints |
`assert!(true)` / `assert!(false)` will be optimized out by the compiler, and should probably be replaced by a `panic!()`
or `unreachable!()`
|
3 |
False |
| RS.CLIPPY.ASSERTIONS_ON_RESULT_STATES
|
Rust Clippy Lints |
`assert!(r.is_ok())` or `assert!(r.is_err())` gives worse panic messages than directly calling `r.unwrap()` or `r.unwrap_err()` |
3 |
False |
| RS.CLIPPY.ASSIGNING_CLONES
|
Rust Clippy Lints |
assigning the result of cloning may be inefficient |
3 |
False |
| RS.CLIPPY.ASSIGN_OP_PATTERN
|
Rust Clippy Lints |
assigning the result of an operation on a variable to that same variable |
3 |
False |
| RS.CLIPPY.ASYNC_YIELDS_ASYNC
|
Rust Clippy Lints |
async blocks that return a type that can be awaited |
3 |
False |
| RS.CLIPPY.AS_CONVERSIONS
|
Rust Clippy Lints |
using a potentially dangerous silent `as` conversion |
3 |
False |
| RS.CLIPPY.AS_POINTER_UNDERSCORE
|
Rust Clippy Lints |
detects `as *mut _` and `as *const _` conversion |
3 |
False |
| RS.CLIPPY.AS_PTR_CAST_MUT
|
Rust Clippy Lints |
casting the result of the `&self`-taking `as_ptr` to a mutable pointer |
3 |
False |
| RS.CLIPPY.AS_UNDERSCORE
|
Rust Clippy Lints |
detects `as _` conversion |
3 |
False |
| RS.CLIPPY.AWAIT_HOLDING_INVALID_TYPE
|
Rust Clippy Lints |
holding a type across an await point which is not allowed to be held as per the configuration |
3 |
False |
| RS.CLIPPY.AWAIT_HOLDING_LOCK
|
Rust Clippy Lints |
inside an async function, holding a `MutexGuard` while calling `await` |
3 |
False |
| RS.CLIPPY.AWAIT_HOLDING_REFCELL_REF
|
Rust Clippy Lints |
inside an async function, holding a `RefCell` ref while calling `await` |
3 |
False |
| RS.CLIPPY.BAD_BIT_MASK
|
Rust Clippy Lints |
expressions of the form `_ & mask == select` that will only ever return `true` or `false` |
3 |
False |
| RS.CLIPPY.BIG_ENDIAN_BYTES
|
Rust Clippy Lints |
disallows usage of the `to_be_bytes` method |
3 |
False |
| RS.CLIPPY.BIND_INSTEAD_OF_MAP
|
Rust Clippy Lints |
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` |
3 |
False |
| RS.CLIPPY.BLANKET_CLIPPY_RESTRICTION_LINTS
|
Rust Clippy Lints |
enabling the complete restriction group |
3 |
False |
| RS.CLIPPY.BLOCKS_IN_CONDITIONS
|
Rust Clippy Lints |
useless or complex blocks that can be eliminated in conditions |
3 |
False |
| RS.CLIPPY.BOOL_ASSERT_COMPARISON
|
Rust Clippy Lints |
Using a boolean as comparison value in an assert_* macro when there is no need |
3 |
False |
| RS.CLIPPY.BOOL_COMPARISON
|
Rust Clippy Lints |
comparing a variable to a boolean, e.g., `if x == true` or `if x != true` |
3 |
False |
| RS.CLIPPY.BOOL_TO_INT_WITH_IF
|
Rust Clippy Lints |
using if to convert bool to int |
3 |
False |
| RS.CLIPPY.BORROWED_BOX
|
Rust Clippy Lints |
a borrow of a boxed type |
3 |
False |
| RS.CLIPPY.BORROW_AS_PTR
|
Rust Clippy Lints |
borrowing just to cast to a raw pointer |
3 |
False |
| RS.CLIPPY.BORROW_DEREF_REF
|
Rust Clippy Lints |
deref on an immutable reference returns the same type as itself |
3 |
False |
| RS.CLIPPY.BORROW_INTERIOR_MUTABLE_CONST
|
Rust Clippy Lints |
referencing `const` with interior mutability |
3 |
False |
| RS.CLIPPY.BOXED_LOCAL
|
Rust Clippy Lints |
using `Box<T>` where unnecessary |
3 |
False |
| RS.CLIPPY.BOX_COLLECTION
|
Rust Clippy Lints |
usage of `Box<Vec<T>>`, vector elements are already on the heap |
3 |
False |
| RS.CLIPPY.BOX_DEFAULT
|
Rust Clippy Lints |
Using Box::new(T::default()) instead of Box::default() |
3 |
False |
| RS.CLIPPY.BRANCHES_SHARING_CODE
|
Rust Clippy Lints |
`if` statement with shared code in all blocks |
3 |
False |
| RS.CLIPPY.BUILTIN_TYPE_SHADOW
|
Rust Clippy Lints |
shadowing a builtin type |
3 |
False |
| RS.CLIPPY.BYTES_COUNT_TO_LEN
|
Rust Clippy Lints |
Using `bytes().count()` when `len()` performs the same functionality |
3 |
False |
| RS.CLIPPY.BYTES_NTH
|
Rust Clippy Lints |
replace `.bytes().nth()` with `.as_bytes().get()` |
3 |
False |
| RS.CLIPPY.BYTE_CHAR_SLICES
|
Rust Clippy Lints |
hard to read byte char slice |
3 |
False |
| RS.CLIPPY.CARGO_COMMON_METADATA
|
Rust Clippy Lints |
common metadata is defined in `Cargo.toml` |
3 |
False |
| RS.CLIPPY.CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS
|
Rust Clippy Lints |
Checks for calls to ends_with with case-sensitive file extensions |
3 |
False |
| RS.CLIPPY.CAST_ABS_TO_UNSIGNED
|
Rust Clippy Lints |
casting the result of `abs()` to an unsigned integer can panic |
3 |
False |
| RS.CLIPPY.CAST_ENUM_CONSTRUCTOR
|
Rust Clippy Lints |
casts from an enum tuple constructor to an integer |
3 |
False |
| RS.CLIPPY.CAST_ENUM_TRUNCATION
|
Rust Clippy Lints |
casts from an enum type to an integral type that will truncate the value |
3 |
False |
| RS.CLIPPY.CAST_LOSSLESS
|
Rust Clippy Lints |
casts using `as` that are known to be lossless, e.g., `x as u64` where `x: u8` |
3 |
False |
| RS.CLIPPY.CAST_NAN_TO_INT
|
Rust Clippy Lints |
casting a known floating-point NaN into an integer |
3 |
False |
| RS.CLIPPY.CAST_POSSIBLE_TRUNCATION
|
Rust Clippy Lints |
casts that may cause truncation of the value, e.g., `x as u8` where `x: u32`, or `x as i32` where `x: f32` |
3 |
False |
| RS.CLIPPY.CAST_POSSIBLE_WRAP
|
Rust Clippy Lints |
casts that may cause wrapping around the value, e.g., `x as i32` where `x: u32` and `x > i32::MAX` |
3 |
False |
| RS.CLIPPY.CAST_PRECISION_LOSS
|
Rust Clippy Lints |
casts that cause loss of precision, e.g., `x as f32` where `x: u64` |
3 |
False |
| RS.CLIPPY.CAST_PTR_ALIGNMENT
|
Rust Clippy Lints |
cast from a pointer to a more strictly aligned pointer |
3 |
False |
| RS.CLIPPY.CAST_SIGN_LOSS
|
Rust Clippy Lints |
casts from signed types to unsigned types, e.g., `x as u32` where `x: i32` |
3 |
False |
| RS.CLIPPY.CAST_SLICE_DIFFERENT_SIZES
|
Rust Clippy Lints |
casting using `as` between raw pointers to slices of types with different sizes |
3 |
False |
| RS.CLIPPY.CAST_SLICE_FROM_RAW_PARTS
|
Rust Clippy Lints |
casting a slice created from a pointer and length to a slice pointer |
3 |
False |
| RS.CLIPPY.CFG_NOT_TEST
|
Rust Clippy Lints |
enforce against excluding code from test builds |
3 |
False |
| RS.CLIPPY.CHARS_LAST_CMP
|
Rust Clippy Lints |
using `.chars().last()` or `.chars().next_back()` to check if a string ends with a char |
3 |
False |
| RS.CLIPPY.CHARS_NEXT_CMP
|
Rust Clippy Lints |
using `.chars().next()` to check if a string starts with a char |
3 |
False |
| RS.CLIPPY.CHAR_INDICES_AS_BYTE_INDICES
|
Rust Clippy Lints |
using the character position yielded by `.chars().enumerate()` in a context where a byte index is expected |
3 |
False |
| RS.CLIPPY.CHAR_LIT_AS_U8
|
Rust Clippy Lints |
casting a character literal to `u8` truncates |
3 |
False |
| RS.CLIPPY.CHECKED_CONVERSIONS
|
Rust Clippy Lints |
`try_from` could replace manual bounds checking when casting |
3 |
False |
| RS.CLIPPY.CLEAR_WITH_DRAIN
|
Rust Clippy Lints |
calling `drain` in order to `clear` a container |
3 |
False |
| RS.CLIPPY.CLONED_INSTEAD_OF_COPIED
|
Rust Clippy Lints |
used `cloned` where `copied` could be used instead |
3 |
False |
| RS.CLIPPY.CLONED_REF_TO_SLICE_REFS
|
Rust Clippy Lints |
cloning a reference for slice references |
3 |
False |
| RS.CLIPPY.CLONE_ON_COPY
|
Rust Clippy Lints |
using `clone` on a `Copy` type |
3 |
False |
| RS.CLIPPY.CLONE_ON_REF_PTR
|
Rust Clippy Lints |
using `clone` on a ref-counted pointer |
3 |
False |
| RS.CLIPPY.CMP_NULL
|
Rust Clippy Lints |
comparing a pointer to a null pointer, suggesting to use `.is_null()` instead |
3 |
False |
| RS.CLIPPY.CMP_OWNED
|
Rust Clippy Lints |
creating owned instances for comparing with others, e.g., `x == \"foo\".to_string()` |
3 |
False |
| RS.CLIPPY.COERCE_CONTAINER_TO_ANY
|
Rust Clippy Lints |
coercing to `&dyn Any` when dereferencing could produce a `dyn Any` without coercion is usually not intended |
3 |
False |
| RS.CLIPPY.COGNITIVE_COMPLEXITY
|
Rust Clippy Lints |
@eval_always = true |
3 |
False |
| RS.CLIPPY.COLLAPSIBLE_ELSE_IF
|
Rust Clippy Lints |
nested `else`-`if` expressions that can be collapsed (e.g., `else { if x { ... } }`) |
3 |
False |
| RS.CLIPPY.COLLAPSIBLE_IF
|
Rust Clippy Lints |
nested `if`s that can be collapsed (e.g., `if x { if y { ... } }` |
3 |
False |
| RS.CLIPPY.COLLAPSIBLE_MATCH
|
Rust Clippy Lints |
Nested `match` or `if let` expressions where the patterns may be \"collapsed\" together. |
3 |
False |
| RS.CLIPPY.COLLAPSIBLE_STR_REPLACE
|
Rust Clippy Lints |
collapse consecutive calls to str::replace (2 or more) into a single call |
3 |
False |
| RS.CLIPPY.COLLECTION_IS_NEVER_READ
|
Rust Clippy Lints |
a collection is never queried |
3 |
False |
| RS.CLIPPY.COMPARISON_CHAIN
|
Rust Clippy Lints |
`if`s that can be rewritten with `match` and `cmp` |
3 |
False |
| RS.CLIPPY.COMPARISON_TO_EMPTY
|
Rust Clippy Lints |
checking `x == \"\"` or `x == []` (or similar) when `.is_empty()` could be used instead |
3 |
False |
| RS.CLIPPY.CONFUSING_METHOD_TO_NUMERIC_CAST
|
Rust Clippy Lints |
casting a primitive method pointer to any integer type |
3 |
False |
| RS.CLIPPY.CONST_IS_EMPTY
|
Rust Clippy Lints |
is_empty() called on strings known at compile time |
3 |
False |
| RS.CLIPPY.COPY_ITERATOR
|
Rust Clippy Lints |
implementing `Iterator` on a `Copy` type |
3 |
False |
| RS.CLIPPY.CRATE_IN_MACRO_DEF
|
Rust Clippy Lints |
using `crate` in a macro definition |
3 |
False |
| RS.CLIPPY.CREATE_DIR
|
Rust Clippy Lints |
calling `std::fs::create_dir` instead of `std::fs::create_dir_all` |
3 |
False |
| RS.CLIPPY.CROSSPOINTER_TRANSMUTE
|
Rust Clippy Lints |
transmutes that have to or from types that are a pointer to the other |
3 |
False |
| RS.CLIPPY.DBG_MACRO
|
Rust Clippy Lints |
`dbg!` macro is intended as a debugging tool |
3 |
False |
| RS.CLIPPY.DEBUG_ASSERT_WITH_MUT_CALL
|
Rust Clippy Lints |
mutable arguments in `debug_assert{,_ne,_eq}!` |
3 |
False |
| RS.CLIPPY.DECIMAL_LITERAL_REPRESENTATION
|
Rust Clippy Lints |
using decimal representation when hexadecimal would be better |
3 |
False |
| RS.CLIPPY.DECLARE_INTERIOR_MUTABLE_CONST
|
Rust Clippy Lints |
declaring `const` with interior mutability |
3 |
False |
| RS.CLIPPY.DEFAULT_CONSTRUCTED_UNIT_STRUCTS
|
Rust Clippy Lints |
unit structs can be constructed without calling `default` |
3 |
False |
| RS.CLIPPY.DEFAULT_INSTEAD_OF_ITER_EMPTY
|
Rust Clippy Lints |
check `std::iter::Empty::default()` and replace with `std::iter::empty()` |
3 |
False |
| RS.CLIPPY.DEFAULT_NUMERIC_FALLBACK
|
Rust Clippy Lints |
usage of unconstrained numeric literals which may cause default numeric fallback. |
3 |
False |
| RS.CLIPPY.DEFAULT_TRAIT_ACCESS
|
Rust Clippy Lints |
checks for literal calls to `Default::default()` |
3 |
False |
| RS.CLIPPY.DEFAULT_UNION_REPRESENTATION
|
Rust Clippy Lints |
unions without a `#[repr(C)]` attribute |
3 |
False |
| RS.CLIPPY.DEPRECATED_CFG_ATTR
|
Rust Clippy Lints |
usage of `cfg_attr(rustfmt)` instead of tool attributes |
3 |
False |
| RS.CLIPPY.DEPRECATED_CLIPPY_CFG_ATTR
|
Rust Clippy Lints |
usage of `cfg(feature = \"cargo-clippy\")` instead of `cfg(clippy)` |
3 |
False |
| RS.CLIPPY.DEPRECATED_SEMVER
|
Rust Clippy Lints |
use of `#[deprecated(since = \"x\")]` where x is not semver |
3 |
False |
| RS.CLIPPY.DEREF_ADDROF
|
Rust Clippy Lints |
use of `*&` or `*&mut` in an expression |
3 |
False |
| RS.CLIPPY.DEREF_BY_SLICING
|
Rust Clippy Lints |
slicing instead of dereferencing |
3 |
False |
| RS.CLIPPY.DERIVABLE_IMPLS
|
Rust Clippy Lints |
manual implementation of the `Default` trait which is equal to a derive |
3 |
False |
| RS.CLIPPY.DERIVED_HASH_WITH_MANUAL_EQ
|
Rust Clippy Lints |
deriving `Hash` but implementing `PartialEq` explicitly |
3 |
False |
| RS.CLIPPY.DERIVE_ORD_XOR_PARTIAL_ORD
|
Rust Clippy Lints |
deriving `Ord` but implementing `PartialOrd` explicitly |
3 |
False |
| RS.CLIPPY.DERIVE_PARTIAL_EQ_WITHOUT_EQ
|
Rust Clippy Lints |
deriving `PartialEq` on a type that can implement `Eq`, without implementing `Eq` |
3 |
False |
| RS.CLIPPY.DISALLOWED_MACROS
|
Rust Clippy Lints |
use of a disallowed macro |
3 |
False |
| RS.CLIPPY.DISALLOWED_METHODS
|
Rust Clippy Lints |
use of a disallowed method call |
3 |
False |
| RS.CLIPPY.DISALLOWED_NAMES
|
Rust Clippy Lints |
usage of a disallowed/placeholder name |
3 |
False |
| RS.CLIPPY.DISALLOWED_SCRIPT_IDENTS
|
Rust Clippy Lints |
usage of non-allowed Unicode scripts |
3 |
False |
| RS.CLIPPY.DISALLOWED_TYPES
|
Rust Clippy Lints |
use of disallowed types |
3 |
False |
| RS.CLIPPY.DIVERGING_SUB_EXPRESSION
|
Rust Clippy Lints |
whether an expression contains a diverging sub expression |
3 |
False |
| RS.CLIPPY.DOC_COMMENT_DOUBLE_SPACE_LINEBREAKS
|
Rust Clippy Lints |
double-space used for doc comment linebreak instead of `\\` |
3 |
False |
| RS.CLIPPY.DOC_INCLUDE_WITHOUT_CFG
|
Rust Clippy Lints |
check if files included in documentation are behind `cfg(doc)` |
3 |
False |
| RS.CLIPPY.DOC_LAZY_CONTINUATION
|
Rust Clippy Lints |
require every line of a paragraph to be indented and marked |
3 |
False |
| RS.CLIPPY.DOC_LINK_CODE
|
Rust Clippy Lints |
link with code back-to-back with other code |
3 |
False |
| RS.CLIPPY.DOC_LINK_WITH_QUOTES
|
Rust Clippy Lints |
possible typo for an intra-doc link |
3 |
False |
| RS.CLIPPY.DOC_MARKDOWN
|
Rust Clippy Lints |
presence of `_`, `::` or camel-case outside backticks in documentation |
3 |
False |
| RS.CLIPPY.DOC_NESTED_REFDEFS
|
Rust Clippy Lints |
link reference defined in list item or quote |
3 |
False |
| RS.CLIPPY.DOC_OVERINDENTED_LIST_ITEMS
|
Rust Clippy Lints |
ensure list items are not overindented |
3 |
False |
| RS.CLIPPY.DOC_SUSPICIOUS_FOOTNOTES
|
Rust Clippy Lints |
looks like a link or footnote ref, but with no definition |
3 |
False |
| RS.CLIPPY.DOUBLE_COMPARISONS
|
Rust Clippy Lints |
unnecessary double comparisons that can be simplified |
3 |
False |
| RS.CLIPPY.DOUBLE_ENDED_ITERATOR_LAST
|
Rust Clippy Lints |
using `Iterator::last` on a `DoubleEndedIterator` |
3 |
False |
| RS.CLIPPY.DOUBLE_MUST_USE
|
Rust Clippy Lints |
`#[must_use]` attribute on a `#[must_use]`-returning function / method |
3 |
False |
| RS.CLIPPY.DOUBLE_PARENS
|
Rust Clippy Lints |
Warn on unnecessary double parentheses |
3 |
False |
| RS.CLIPPY.DRAIN_COLLECT
|
Rust Clippy Lints |
calling `.drain(..).collect()` to move all elements into a new collection |
3 |
False |
| RS.CLIPPY.DROP_NON_DROP
|
Rust Clippy Lints |
call to `std::mem::drop` with a value which does not implement `Drop` |
3 |
False |
| RS.CLIPPY.DUPLICATED_ATTRIBUTES
|
Rust Clippy Lints |
duplicated attribute |
3 |
False |
| RS.CLIPPY.DUPLICATE_MOD
|
Rust Clippy Lints |
file loaded as module multiple times |
3 |
False |
| RS.CLIPPY.DUPLICATE_UNDERSCORE_ARGUMENT
|
Rust Clippy Lints |
function arguments having names which only differ by an underscore |
3 |
False |
| RS.CLIPPY.DURATION_SUBSEC
|
Rust Clippy Lints |
checks for calculation of subsecond microseconds or milliseconds |
3 |
False |
| RS.CLIPPY.EAGER_TRANSMUTE
|
Rust Clippy Lints |
eager evaluation of `transmute` |
3 |
False |
| RS.CLIPPY.ELIDABLE_LIFETIME_NAMES
|
Rust Clippy Lints |
lifetime name that can be replaced with the anonymous lifetime |
3 |
False |
| RS.CLIPPY.ELSE_IF_WITHOUT_ELSE
|
Rust Clippy Lints |
`if` expression with an `else if`, but without a final `else` branch |
3 |
False |
| RS.CLIPPY.EMPTY_DOCS
|
Rust Clippy Lints |
docstrings exist but documentation is empty |
3 |
False |
| RS.CLIPPY.EMPTY_DROP
|
Rust Clippy Lints |
empty `Drop` implementations |
3 |
False |
| RS.CLIPPY.EMPTY_ENUM
|
Rust Clippy Lints |
enum with no variants |
3 |
False |
| RS.CLIPPY.EMPTY_ENUM_VARIANTS_WITH_BRACKETS
|
Rust Clippy Lints |
finds enum variants with empty brackets |
3 |
False |
| RS.CLIPPY.EMPTY_LINE_AFTER_DOC_COMMENTS
|
Rust Clippy Lints |
empty line after doc comments |
3 |
False |
| RS.CLIPPY.EMPTY_LINE_AFTER_OUTER_ATTR
|
Rust Clippy Lints |
empty line after outer attribute |
3 |
False |
| RS.CLIPPY.EMPTY_LOOP
|
Rust Clippy Lints |
empty `loop {}`, which should block or sleep |
3 |
False |
| RS.CLIPPY.EMPTY_STRUCTS_WITH_BRACKETS
|
Rust Clippy Lints |
finds struct declarations with empty brackets |
3 |
False |
| RS.CLIPPY.ENUM_CLIKE_UNPORTABLE_VARIANT
|
Rust Clippy Lints |
C-like enums that are `repr(isize/usize)` and have values that don't fit into an `i32` |
3 |
False |
| RS.CLIPPY.ENUM_GLOB_USE
|
Rust Clippy Lints |
use items that import all variants of an enum |
3 |
False |
| RS.CLIPPY.ENUM_VARIANT_NAMES
|
Rust Clippy Lints |
enums where all variants share a prefix/postfix |
3 |
False |
| RS.CLIPPY.EQUATABLE_IF_LET
|
Rust Clippy Lints |
using pattern matching instead of equality |
3 |
False |
| RS.CLIPPY.EQ_OP
|
Rust Clippy Lints |
equal operands on both sides of a comparison or bitwise combination (e.g., `x == x`) |
3 |
False |
| RS.CLIPPY.ERASING_OP
|
Rust Clippy Lints |
using erasing operations, e.g., `x * 0` or `y & 0` |
3 |
False |
| RS.CLIPPY.ERROR_IMPL_ERROR
|
Rust Clippy Lints |
exported types named `Error` that implement `Error` |
3 |
False |
| RS.CLIPPY.ERR_EXPECT
|
Rust Clippy Lints |
r#"using `.err().expect("")` when `.expect_err("")` can be used"# |
3 |
False |
| RS.CLIPPY.EXCESSIVE_NESTING
|
Rust Clippy Lints |
checks for blocks nested beyond a certain threshold |
3 |
False |
| RS.CLIPPY.EXCESSIVE_PRECISION
|
Rust Clippy Lints |
excessive precision for float literal |
3 |
False |
| RS.CLIPPY.EXHAUSTIVE_ENUMS
|
Rust Clippy Lints |
detects exported enums that have not been marked #[non_exhaustive] |
3 |
False |
| RS.CLIPPY.EXHAUSTIVE_STRUCTS
|
Rust Clippy Lints |
detects exported structs that have not been marked #[non_exhaustive] |
3 |
False |
| RS.CLIPPY.EXIT
|
Rust Clippy Lints |
detects `std::process::exit` calls |
3 |
False |
| RS.CLIPPY.EXPECT_FUN_CALL
|
Rust Clippy Lints |
using any `expect` method with a function call |
3 |
False |
| RS.CLIPPY.EXPECT_USED
|
Rust Clippy Lints |
using `.expect()` on `Result` or `Option`, which might be better handled |
3 |
False |
| RS.CLIPPY.EXPLICIT_AUTO_DEREF
|
Rust Clippy Lints |
dereferencing when the compiler would automatically dereference |
3 |
False |
| RS.CLIPPY.EXPLICIT_COUNTER_LOOP
|
Rust Clippy Lints |
for-looping with an explicit counter when `_.enumerate()` would do |
3 |
False |
| RS.CLIPPY.EXPLICIT_DEREF_METHODS
|
Rust Clippy Lints |
Explicit use of deref or deref_mut method while not in a method chain. |
3 |
False |
| RS.CLIPPY.EXPLICIT_INTO_ITER_LOOP
|
Rust Clippy Lints |
for-looping over `_.into_iter()` when `_` would do |
3 |
False |
| RS.CLIPPY.EXPLICIT_ITER_LOOP
|
Rust Clippy Lints |
for-looping over `_.iter()` or `_.iter_mut()` when `&_` or `&mut _` would do |
3 |
False |
| RS.CLIPPY.EXPLICIT_WRITE
|
Rust Clippy Lints |
using the `write!()` family of functions instead of the `print!()` family of functions, when using the latter would work |
3 |
False |
| RS.CLIPPY.EXPL_IMPL_CLONE_ON_COPY
|
Rust Clippy Lints |
implementing `Clone` explicitly on `Copy` types |
3 |
False |
| RS.CLIPPY.EXTEND_WITH_DRAIN
|
Rust Clippy Lints |
using vec.append(&mut vec) to move the full range of a vector to another |
3 |
False |
| RS.CLIPPY.EXTRA_UNUSED_LIFETIMES
|
Rust Clippy Lints |
unused lifetimes in function definitions |
3 |
False |
| RS.CLIPPY.EXTRA_UNUSED_TYPE_PARAMETERS
|
Rust Clippy Lints |
unused type parameters in function definitions |
3 |
False |
| RS.CLIPPY.FALLIBLE_IMPL_FROM
|
Rust Clippy Lints |
Warn on impls of `From<..>` that contain `panic!()` or `unwrap()` |
3 |
False |
| RS.CLIPPY.FIELD_REASSIGN_WITH_DEFAULT
|
Rust Clippy Lints |
binding initialized with Default should have its fields set in the initializer |
3 |
False |
| RS.CLIPPY.FIELD_SCOPED_VISIBILITY_MODIFIERS
|
Rust Clippy Lints |
checks for usage of a scoped visibility modifier, like `pub(crate)`, on fields |
3 |
False |
| RS.CLIPPY.FILETYPE_IS_FILE
|
Rust Clippy Lints |
`FileType::is_file` is not recommended to test for readable file type |
3 |
False |
| RS.CLIPPY.FILTER_MAP_BOOL_THEN
|
Rust Clippy Lints |
checks for usage of `bool::then` in `Iterator::filter_map` |
3 |
False |
| RS.CLIPPY.FILTER_MAP_IDENTITY
|
Rust Clippy Lints |
call to `filter_map` where `flatten` is sufficient |
3 |
False |
| RS.CLIPPY.FILTER_MAP_NEXT
|
Rust Clippy Lints |
using combination of `filter_map` and `next` which can usually be written as a single method call |
3 |
False |
| RS.CLIPPY.FILTER_NEXT
|
Rust Clippy Lints |
using `filter(p).next()`, which is more succinctly expressed as `.find(p)` |
3 |
False |
| RS.CLIPPY.FLAT_MAP_IDENTITY
|
Rust Clippy Lints |
call to `flat_map` where `flatten` is sufficient |
3 |
False |
| RS.CLIPPY.FLAT_MAP_OPTION
|
Rust Clippy Lints |
used `flat_map` where `filter_map` could be used instead |
3 |
False |
| RS.CLIPPY.FLOAT_ARITHMETIC
|
Rust Clippy Lints |
any floating-point arithmetic statement |
3 |
False |
| RS.CLIPPY.FLOAT_CMP
|
Rust Clippy Lints |
using `==` or `!=` on float values instead of comparing difference with an allowed error |
3 |
False |
| RS.CLIPPY.FLOAT_CMP_CONST
|
Rust Clippy Lints |
using `==` or `!=` on float constants instead of comparing difference with an allowed error |
3 |
False |
| RS.CLIPPY.FLOAT_EQUALITY_WITHOUT_ABS
|
Rust Clippy Lints |
float equality check without `.abs()` |
3 |
False |
| RS.CLIPPY.FN_PARAMS_EXCESSIVE_BOOLS
|
Rust Clippy Lints |
using too many bools in function parameters |
3 |
False |
| RS.CLIPPY.FN_TO_NUMERIC_CAST
|
Rust Clippy Lints |
casting a function pointer to a numeric type other than `usize` |
3 |
False |
| RS.CLIPPY.FN_TO_NUMERIC_CAST_ANY
|
Rust Clippy Lints |
casting a function pointer to any integer type |
3 |
False |
| RS.CLIPPY.FN_TO_NUMERIC_CAST_WITH_TRUNCATION
|
Rust Clippy Lints |
casting a function pointer to a numeric type not wide enough to store the address |
3 |
False |
| RS.CLIPPY.FORGET_NON_DROP
|
Rust Clippy Lints |
call to `std::mem::forget` with a value which does not implement `Drop` |
3 |
False |
| RS.CLIPPY.FORMAT_COLLECT
|
Rust Clippy Lints |
`format!`ing every element in a collection, then collecting the strings into a new `String` |
3 |
False |
| RS.CLIPPY.FORMAT_IN_FORMAT_ARGS
|
Rust Clippy Lints |
`format!` used in a macro that does formatting |
3 |
False |
| RS.CLIPPY.FORMAT_PUSH_STRING
|
Rust Clippy Lints |
`format!(..)` appended to existing `String` |
3 |
False |
| RS.CLIPPY.FOR_KV_MAP
|
Rust Clippy Lints |
looping on a map using `iter` when `keys` or `values` would do |
3 |
False |
| RS.CLIPPY.FOUR_FORWARD_SLASHES
|
Rust Clippy Lints |
comments with 4 forward slashes (`////`) likely intended to be doc comments (`///`) |
3 |
False |
| RS.CLIPPY.FROM_ITER_INSTEAD_OF_COLLECT
|
Rust Clippy Lints |
use `.collect()` instead of `::from_iter()` |
3 |
False |
| RS.CLIPPY.FROM_OVER_INTO
|
Rust Clippy Lints |
Warns on implementations of `Into<..>` to use `From<..>` |
3 |
False |
| RS.CLIPPY.FROM_RAW_WITH_VOID_PTR
|
Rust Clippy Lints |
creating a `Box` from a void raw pointer |
3 |
False |
| RS.CLIPPY.FROM_STR_RADIX_10
|
Rust Clippy Lints |
from_str_radix with radix 10 |
3 |
False |
| RS.CLIPPY.FUTURE_NOT_SEND
|
Rust Clippy Lints |
public Futures must be Send |
3 |
False |
| RS.CLIPPY.GET_FIRST
|
Rust Clippy Lints |
Using `x.get(0)` when `x.first()` or `x.front()` is simpler |
3 |
False |
| RS.CLIPPY.GET_LAST_WITH_LEN
|
Rust Clippy Lints |
Using `x.get(x.len() - 1)` when `x.last()` is correct and simpler |
3 |
False |
| RS.CLIPPY.GET_UNWRAP
|
Rust Clippy Lints |
using `.get().unwrap()` or `.get_mut().unwrap()` when using `[]` would work instead |
3 |
False |
| RS.CLIPPY.HOST_ENDIAN_BYTES
|
Rust Clippy Lints |
disallows usage of the `to_ne_bytes` method |
3 |
False |
| RS.CLIPPY.IDENTITY_OP
|
Rust Clippy Lints |
using identity operations, e.g., `x + 0` or `y / 1` |
3 |
False |
| RS.CLIPPY.IFS_SAME_COND
|
Rust Clippy Lints |
consecutive `if`s with the same condition |
3 |
False |
| RS.CLIPPY.IF_LET_MUTEX
|
Rust Clippy Lints |
locking a `Mutex` in an `if let` block can cause deadlocks |
3 |
False |
| RS.CLIPPY.IF_NOT_ELSE
|
Rust Clippy Lints |
`if` branches that could be swapped so no negation operation is necessary on the condition |
3 |
False |
| RS.CLIPPY.IF_SAME_THEN_ELSE
|
Rust Clippy Lints |
`if` with the same `then` and `else` blocks |
3 |
False |
| RS.CLIPPY.IF_THEN_SOME_ELSE_NONE
|
Rust Clippy Lints |
Finds if-else that could be written using either `bool::then` or `bool::then_some` |
3 |
False |
| RS.CLIPPY.IGNORED_UNIT_PATTERNS
|
Rust Clippy Lints |
suggest replacing `_` by `()` in patterns where appropriate |
3 |
False |
| RS.CLIPPY.IGNORE_WITHOUT_REASON
|
Rust Clippy Lints |
ignored tests without messages |
3 |
False |
| RS.CLIPPY.IMPLICIT_CLONE
|
Rust Clippy Lints |
implicitly cloning a value by invoking a function on its dereferenced type |
3 |
False |
| RS.CLIPPY.IMPLICIT_HASHER
|
Rust Clippy Lints |
missing generalization over different hashers |
3 |
False |
| RS.CLIPPY.IMPLICIT_RETURN
|
Rust Clippy Lints |
use a return statement like `return expr` instead of an expression |
3 |
False |
| RS.CLIPPY.IMPLICIT_SATURATING_ADD
|
Rust Clippy Lints |
Perform saturating addition instead of implicitly checking max bound of data type |
3 |
False |
| RS.CLIPPY.IMPLICIT_SATURATING_SUB
|
Rust Clippy Lints |
Perform saturating subtraction instead of implicitly checking lower bound of data type |
3 |
False |
| RS.CLIPPY.IMPLIED_BOUNDS_IN_IMPLS
|
Rust Clippy Lints |
specifying bounds that are implied by other bounds in `impl Trait` type |
3 |
False |
| RS.CLIPPY.IMPL_HASH_BORROW_WITH_STR_AND_BYTES
|
Rust Clippy Lints |
ensures that the semantics of `Borrow` for `Hash` are satisfied when `Borrow<str>` and `Borrow<[u8]>` are implemented |
3 |
False |
| RS.CLIPPY.IMPL_TRAIT_IN_PARAMS
|
Rust Clippy Lints |
`impl Trait` is used in the function's parameters |
3 |
False |
| RS.CLIPPY.IMPOSSIBLE_COMPARISONS
|
Rust Clippy Lints |
double comparisons that will never evaluate to `true` |
3 |
False |
| RS.CLIPPY.IMPRECISE_FLOPS
|
Rust Clippy Lints |
usage of imprecise floating point operations |
3 |
False |
| RS.CLIPPY.INCOMPATIBLE_MSRV
|
Rust Clippy Lints |
ensures that all items used in the crate are available for the current MSRV |
3 |
False |
| RS.CLIPPY.INCONSISTENT_DIGIT_GROUPING
|
Rust Clippy Lints |
integer literals with digits grouped inconsistently |
3 |
False |
| RS.CLIPPY.INCONSISTENT_STRUCT_CONSTRUCTOR
|
Rust Clippy Lints |
the order of the field init is inconsistent with the order in the struct definition |
3 |
False |
| RS.CLIPPY.INDEXING_SLICING
|
Rust Clippy Lints |
indexing/slicing usage |
3 |
False |
| RS.CLIPPY.INDEX_REFUTABLE_SLICE
|
Rust Clippy Lints |
avoid indexing on slices which could be destructed |
3 |
False |
| RS.CLIPPY.INEFFECTIVE_BIT_MASK
|
Rust Clippy Lints |
expressions where a bit mask will be rendered useless by a comparison, e.g., `(x | 1) > 2` |
3 |
False |
| RS.CLIPPY.INEFFECTIVE_OPEN_OPTIONS
|
Rust Clippy Lints |
usage of both `write(true)` and `append(true)` on same `OpenOptions` |
3 |
False |
| RS.CLIPPY.INEFFICIENT_TO_STRING
|
Rust Clippy Lints |
using `to_string` on `&&T` where `T: ToString` |
3 |
False |
| RS.CLIPPY.INFALLIBLE_DESTRUCTURING_MATCH
|
Rust Clippy Lints |
a `match` statement with a single infallible arm instead of a `let` |
3 |
False |
| RS.CLIPPY.INFALLIBLE_TRY_FROM
|
Rust Clippy Lints |
TryFrom with infallible Error type |
3 |
False |
| RS.CLIPPY.INFINITE_ITER
|
Rust Clippy Lints |
infinite iteration |
3 |
False |
| RS.CLIPPY.INFINITE_LOOP
|
Rust Clippy Lints |
possibly unintended infinite loop |
3 |
False |
| RS.CLIPPY.INHERENT_TO_STRING
|
Rust Clippy Lints |
type implements inherent method `to_string()`, but should instead implement the `Display` trait |
3 |
False |
| RS.CLIPPY.INHERENT_TO_STRING_SHADOW_DISPLAY
|
Rust Clippy Lints |
type implements inherent method `to_string()`, which gets shadowed by the implementation of the `Display` trait |
3 |
False |
| RS.CLIPPY.INIT_NUMBERED_FIELDS
|
Rust Clippy Lints |
numbered fields in tuple struct initializer |
3 |
False |
| RS.CLIPPY.INLINE_ALWAYS
|
Rust Clippy Lints |
use of `#[inline(always)]` |
3 |
False |
| RS.CLIPPY.INLINE_ASM_X86_ATT_SYNTAX
|
Rust Clippy Lints |
prefer Intel x86 assembly syntax |
3 |
False |
| RS.CLIPPY.INLINE_ASM_X86_INTEL_SYNTAX
|
Rust Clippy Lints |
prefer AT&T x86 assembly syntax |
3 |
False |
| RS.CLIPPY.INLINE_FN_WITHOUT_BODY
|
Rust Clippy Lints |
use of `#[inline]` on trait methods without bodies |
3 |
False |
| RS.CLIPPY.INSPECT_FOR_EACH
|
Rust Clippy Lints |
using `.inspect().for_each()`, which can be replaced with `.for_each()` |
3 |
False |
| RS.CLIPPY.INTEGER_DIVISION
|
Rust Clippy Lints |
integer division may cause loss of precision |
3 |
False |
| RS.CLIPPY.INTEGER_DIVISION_REMAINDER_USED
|
Rust Clippy Lints |
use of disallowed default division and remainder operations |
3 |
False |
| RS.CLIPPY.INTO_ITER_ON_REF
|
Rust Clippy Lints |
using `.into_iter()` on a reference |
3 |
False |
| RS.CLIPPY.INTO_ITER_WITHOUT_ITER
|
Rust Clippy Lints |
implementing `IntoIterator for (&|&mut) Type` without an inherent `iter(_mut)` method |
3 |
False |
| RS.CLIPPY.INT_PLUS_ONE
|
Rust Clippy Lints |
instead of using `x >= y + 1`, use `x > y` |
3 |
False |
| RS.CLIPPY.INVALID_REGEX
|
Rust Clippy Lints |
invalid regular expressions |
3 |
False |
| RS.CLIPPY.INVALID_UPCAST_COMPARISONS
|
Rust Clippy Lints |
a comparison involving an upcast which is always true or false |
3 |
False |
| RS.CLIPPY.INVERTED_SATURATING_SUB
|
Rust Clippy Lints |
Check if a variable is smaller than another one and still subtract from it even if smaller |
3 |
False |
| RS.CLIPPY.INVISIBLE_CHARACTERS
|
Rust Clippy Lints |
using an invisible character in a string literal, which is confusing |
3 |
False |
| RS.CLIPPY.IO_OTHER_ERROR
|
Rust Clippy Lints |
calling `std::io::Error::new(std::io::ErrorKind::Other, _)` |
3 |
False |
| RS.CLIPPY.IP_CONSTANT
|
Rust Clippy Lints |
hardcoded localhost IP address |
3 |
False |
| RS.CLIPPY.IS_DIGIT_ASCII_RADIX
|
Rust Clippy Lints |
use of `char::is_digit(..)` with literal radix of 10 or 16 |
3 |
False |
| RS.CLIPPY.ITEMS_AFTER_STATEMENTS
|
Rust Clippy Lints |
blocks where an item comes after a statement |
3 |
False |
| RS.CLIPPY.ITEMS_AFTER_TEST_MODULE
|
Rust Clippy Lints |
An item was found after the testing module `tests` |
3 |
False |
| RS.CLIPPY.ITERATOR_STEP_BY_ZERO
|
Rust Clippy Lints |
using `Iterator::step_by(0)`, which will panic at runtime |
3 |
False |
| RS.CLIPPY.ITER_CLONED_COLLECT
|
Rust Clippy Lints |
using `.cloned().collect()` on slice to create a `Vec` |
3 |
False |
| RS.CLIPPY.ITER_COUNT
|
Rust Clippy Lints |
replace `.iter().count()` with `.len()` |
3 |
False |
| RS.CLIPPY.ITER_FILTER_IS_OK
|
Rust Clippy Lints |
filtering an iterator over `Result`s for `Ok` can be achieved with `flatten` |
3 |
False |
| RS.CLIPPY.ITER_FILTER_IS_SOME
|
Rust Clippy Lints |
filtering an iterator over `Option`s for `Some` can be achieved with `flatten` |
3 |
False |
| RS.CLIPPY.ITER_KV_MAP
|
Rust Clippy Lints |
iterating on map using `iter` when `keys` or `values` would do |
3 |
False |
| RS.CLIPPY.ITER_NEXT_LOOP
|
Rust Clippy Lints |
for-looping over `_.next()` which is probably not intended |
3 |
False |
| RS.CLIPPY.ITER_NEXT_SLICE
|
Rust Clippy Lints |
using `.iter().next()` on a sliced array, which can be shortened to just `.get()` |
3 |
False |
| RS.CLIPPY.ITER_NOT_RETURNING_ITERATOR
|
Rust Clippy Lints |
methods named `iter` or `iter_mut` that do not return an `Iterator` |
3 |
False |
| RS.CLIPPY.ITER_NTH
|
Rust Clippy Lints |
using `.iter().nth()` on a standard library type with O(1) element access |
3 |
False |
| RS.CLIPPY.ITER_NTH_ZERO
|
Rust Clippy Lints |
replace `iter.nth(0)` with `iter.next()` |
3 |
False |
| RS.CLIPPY.ITER_ON_EMPTY_COLLECTIONS
|
Rust Clippy Lints |
Iterator for empty array |
3 |
False |
| RS.CLIPPY.ITER_ON_SINGLE_ITEMS
|
Rust Clippy Lints |
Iterator for array of length 1 |
3 |
False |
| RS.CLIPPY.ITER_OUT_OF_BOUNDS
|
Rust Clippy Lints |
calls to `.take()` or `.skip()` that are out of bounds |
3 |
False |
| RS.CLIPPY.ITER_OVEREAGER_CLONED
|
Rust Clippy Lints |
using `cloned()` early with `Iterator::iter()` can lead to some performance inefficiencies |
3 |
False |
| RS.CLIPPY.ITER_OVER_HASH_TYPE
|
Rust Clippy Lints |
iterating over unordered hash-based types (`HashMap` and `HashSet`) |
3 |
False |
| RS.CLIPPY.ITER_SKIP_NEXT
|
Rust Clippy Lints |
using `.skip(x).next()` on an iterator |
3 |
False |
| RS.CLIPPY.ITER_SKIP_ZERO
|
Rust Clippy Lints |
disallows `.skip(0)` |
3 |
False |
| RS.CLIPPY.ITER_WITHOUT_INTO_ITER
|
Rust Clippy Lints |
implementing `iter(_mut)` without an associated `IntoIterator for (&|&mut) Type` impl |
3 |
False |
| RS.CLIPPY.ITER_WITH_DRAIN
|
Rust Clippy Lints |
replace `.drain(..)` with `.into_iter()` |
3 |
False |
| RS.CLIPPY.JOIN_ABSOLUTE_PATHS
|
Rust Clippy Lints |
calls to `Path::join` which will overwrite the original path |
3 |
False |
| RS.CLIPPY.JUST_UNDERSCORES_AND_DIGITS
|
Rust Clippy Lints |
unclear name |
3 |
False |
| RS.CLIPPY.LARGE_CONST_ARRAYS
|
Rust Clippy Lints |
large non-scalar const array may cause performance overhead |
3 |
False |
| RS.CLIPPY.LARGE_DIGIT_GROUPS
|
Rust Clippy Lints |
grouping digits into groups that are too large |
3 |
False |
| RS.CLIPPY.LARGE_ENUM_VARIANT
|
Rust Clippy Lints |
large size difference between variants on an enum |
3 |
False |
| RS.CLIPPY.LARGE_FUTURES
|
Rust Clippy Lints |
large future may lead to unexpected stack overflows |
3 |
False |
| RS.CLIPPY.LARGE_INCLUDE_FILE
|
Rust Clippy Lints |
including a large file |
3 |
False |
| RS.CLIPPY.LARGE_STACK_ARRAYS
|
Rust Clippy Lints |
allocating large arrays on stack may cause stack overflow |
3 |
False |
| RS.CLIPPY.LARGE_STACK_FRAMES
|
Rust Clippy Lints |
checks for functions that allocate a lot of stack space |
3 |
False |
| RS.CLIPPY.LARGE_TYPES_PASSED_BY_VALUE
|
Rust Clippy Lints |
functions taking large arguments by value |
3 |
False |
| RS.CLIPPY.LEGACY_NUMERIC_CONSTANTS
|
Rust Clippy Lints |
checks for usage of legacy std numeric constants and methods |
3 |
False |
| RS.CLIPPY.LEN_WITHOUT_IS_EMPTY
|
Rust Clippy Lints |
traits or impls with a public `len` method but no corresponding `is_empty` method |
3 |
False |
| RS.CLIPPY.LEN_ZERO
|
Rust Clippy Lints |
checking `.len() == 0` or `.len() > 0` (or similar) when `.is_empty()` could be used instead |
3 |
False |
| RS.CLIPPY.LET_AND_RETURN
|
Rust Clippy Lints |
creating a let-binding and then immediately returning it like `let x = expr; x` at the end of a block |
3 |
False |
| RS.CLIPPY.LET_UNDERSCORE_FUTURE
|
Rust Clippy Lints |
non-binding `let` on a future |
3 |
False |
| RS.CLIPPY.LET_UNDERSCORE_LOCK
|
Rust Clippy Lints |
non-binding `let` on a synchronization lock |
3 |
False |
| RS.CLIPPY.LET_UNDERSCORE_MUST_USE
|
Rust Clippy Lints |
non-binding `let` on a `#[must_use]` expression |
3 |
False |
| RS.CLIPPY.LET_UNDERSCORE_UNTYPED
|
Rust Clippy Lints |
non-binding `let` without a type annotation |
3 |
False |
| RS.CLIPPY.LET_UNIT_VALUE
|
Rust Clippy Lints |
creating a `let` binding to a value of unit type, which usually can't be used afterwards |
3 |
False |
| RS.CLIPPY.LET_WITH_TYPE_UNDERSCORE
|
Rust Clippy Lints |
unneeded underscore type (`_`) in a variable declaration |
3 |
False |
| RS.CLIPPY.LINES_FILTER_MAP_OK
|
Rust Clippy Lints |
filtering `std::io::Lines` with `filter_map()`, `flat_map()`, or `flatten()` might cause an infinite loop |
3 |
False |
| RS.CLIPPY.LINKEDLIST
|
Rust Clippy Lints |
usage of LinkedList, usually a vector is faster, or a more specialized data structure like a `VecDeque` |
3 |
False |
| RS.CLIPPY.LINT_GROUPS_PRIORITY
|
Rust Clippy Lints |
a lint group in `Cargo.toml` at the same priority as a lint |
3 |
False |
| RS.CLIPPY.LITERAL_STRING_WITH_FORMATTING_ARGS
|
Rust Clippy Lints |
Checks if string literals have formatting arguments |
3 |
False |
| RS.CLIPPY.LITTLE_ENDIAN_BYTES
|
Rust Clippy Lints |
disallows usage of the `to_le_bytes` method |
3 |
False |
| RS.CLIPPY.LOSSY_FLOAT_LITERAL
|
Rust Clippy Lints |
lossy whole number float literals |
3 |
False |
| RS.CLIPPY.MACRO_METAVARS_IN_UNSAFE
|
Rust Clippy Lints |
expanding macro metavariables in an unsafe block |
3 |
False |
| RS.CLIPPY.MACRO_USE_IMPORTS
|
Rust Clippy Lints |
#[macro_use] is no longer needed |
3 |
False |
| RS.CLIPPY.MAIN_RECURSION
|
Rust Clippy Lints |
recursion using the entrypoint |
3 |
False |
| RS.CLIPPY.MANUAL_ABS_DIFF
|
Rust Clippy Lints |
using an if-else pattern instead of `abs_diff` |
3 |
False |
| RS.CLIPPY.MANUAL_ASSERT
|
Rust Clippy Lints |
`panic!` and only a `panic!` in `if`-then statement |
3 |
False |
| RS.CLIPPY.MANUAL_ASYNC_FN
|
Rust Clippy Lints |
manual implementations of `async` functions can be simplified using the dedicated syntax |
3 |
False |
| RS.CLIPPY.MANUAL_BITS
|
Rust Clippy Lints |
manual implementation of `size_of::<T>() * 8` can be simplified with `T::BITS` |
3 |
False |
| RS.CLIPPY.MANUAL_CLAMP
|
Rust Clippy Lints |
using a clamp pattern instead of the clamp function |
3 |
False |
| RS.CLIPPY.MANUAL_CONTAINS
|
Rust Clippy Lints |
unnecessary `iter().any()` on slices that can be replaced with `contains()` |
3 |
False |
| RS.CLIPPY.MANUAL_C_STR_LITERALS
|
Rust Clippy Lints |
r#"creating a `CStr` through functions when `c""` literals can be used"# |
3 |
False |
| RS.CLIPPY.MANUAL_DANGLING_PTR
|
Rust Clippy Lints |
casting small constant literals to pointers to create dangling pointers |
3 |
False |
| RS.CLIPPY.MANUAL_DIV_CEIL
|
Rust Clippy Lints |
manually reimplementing `div_ceil` |
3 |
False |
| RS.CLIPPY.MANUAL_FILTER
|
Rust Clippy Lints |
reimplementation of `filter` |
3 |
False |
| RS.CLIPPY.MANUAL_FILTER_MAP
|
Rust Clippy Lints |
using `_.filter(_).map(_)` in a way that can be written more simply as `filter_map(_)` |
3 |
False |
| RS.CLIPPY.MANUAL_FIND
|
Rust Clippy Lints |
manual implementation of `Iterator::find` |
3 |
False |
| RS.CLIPPY.MANUAL_FIND_MAP
|
Rust Clippy Lints |
using `_.find(_).map(_)` in a way that can be written more simply as `find_map(_)` |
3 |
False |
| RS.CLIPPY.MANUAL_FLATTEN
|
Rust Clippy Lints |
for loops over `Option`s or `Result`s with a single expression can be simplified |
3 |
False |
| RS.CLIPPY.MANUAL_HASH_ONE
|
Rust Clippy Lints |
manual implementations of `BuildHasher::hash_one` |
3 |
False |
| RS.CLIPPY.MANUAL_IGNORE_CASE_CMP
|
Rust Clippy Lints |
manual case-insensitive ASCII comparison |
3 |
False |
| RS.CLIPPY.MANUAL_INSPECT
|
Rust Clippy Lints |
use of `map` returning the original item |
3 |
False |
| RS.CLIPPY.MANUAL_INSTANT_ELAPSED
|
Rust Clippy Lints |
subtraction between `Instant::now()` and previous `Instant` |
3 |
False |
| RS.CLIPPY.MANUAL_IS_ASCII_CHECK
|
Rust Clippy Lints |
use dedicated method to check ascii range |
3 |
False |
| RS.CLIPPY.MANUAL_IS_FINITE
|
Rust Clippy Lints |
use dedicated method to check if a float is finite |
3 |
False |
| RS.CLIPPY.MANUAL_IS_INFINITE
|
Rust Clippy Lints |
use dedicated method to check if a float is infinite |
3 |
False |
| RS.CLIPPY.MANUAL_IS_POWER_OF_TWO
|
Rust Clippy Lints |
manually reimplementing `is_power_of_two` |
3 |
False |
| RS.CLIPPY.MANUAL_IS_VARIANT_AND
|
Rust Clippy Lints |
using `.map(f).unwrap_or_default()`, which is more succinctly expressed as `is_some_and(f)` or `is_ok_and(f)` |
3 |
False |
| RS.CLIPPY.MANUAL_LET_ELSE
|
Rust Clippy Lints |
manual implementation of a let...else statement |
3 |
False |
| RS.CLIPPY.MANUAL_MAIN_SEPARATOR_STR
|
Rust Clippy Lints |
`&std::path::MAIN_SEPARATOR.to_string()` can be replaced by `std::path::MAIN_SEPARATOR_STR` |
3 |
False |
| RS.CLIPPY.MANUAL_MAP
|
Rust Clippy Lints |
reimplementation of `map` |
3 |
False |
| RS.CLIPPY.MANUAL_MEMCPY
|
Rust Clippy Lints |
manually copying items between slices |
3 |
False |
| RS.CLIPPY.MANUAL_MIDPOINT
|
Rust Clippy Lints |
manual implementation of `midpoint` which can overflow |
3 |
False |
| RS.CLIPPY.MANUAL_NEXT_BACK
|
Rust Clippy Lints |
manual reverse iteration of `DoubleEndedIterator` |
3 |
False |
| RS.CLIPPY.MANUAL_NON_EXHAUSTIVE
|
Rust Clippy Lints |
manual implementations of the non-exhaustive pattern can be simplified using #[non_exhaustive] |
3 |
False |
| RS.CLIPPY.MANUAL_OK_ERR
|
Rust Clippy Lints |
find manual implementations of `.ok()` or `.err()` on `Result` |
3 |
False |
| RS.CLIPPY.MANUAL_OK_OR
|
Rust Clippy Lints |
finds patterns that can be encoded more concisely with `Option::ok_or` |
3 |
False |
| RS.CLIPPY.MANUAL_OPTION_AS_SLICE
|
Rust Clippy Lints |
manual `Option::as_slice` |
3 |
False |
| RS.CLIPPY.MANUAL_PATTERN_CHAR_COMPARISON
|
Rust Clippy Lints |
manual char comparison in string patterns |
3 |
False |
| RS.CLIPPY.MANUAL_RANGE_CONTAINS
|
Rust Clippy Lints |
manually reimplementing {`Range`, `RangeInclusive`}`::contains` |
3 |
False |
| RS.CLIPPY.MANUAL_RANGE_PATTERNS
|
Rust Clippy Lints |
manually writing range patterns using a combined OR pattern (`|`) |
3 |
False |
| RS.CLIPPY.MANUAL_REM_EUCLID
|
Rust Clippy Lints |
manually reimplementing `rem_euclid` |
3 |
False |
| RS.CLIPPY.MANUAL_REPEAT_N
|
Rust Clippy Lints |
detect `repeat().take()` that can be replaced with `repeat_n()` |
3 |
False |
| RS.CLIPPY.MANUAL_RETAIN
|
Rust Clippy Lints |
`retain()` is simpler and the same functionalities |
3 |
False |
| RS.CLIPPY.MANUAL_ROTATE
|
Rust Clippy Lints |
using bit shifts to rotate integers |
3 |
False |
| RS.CLIPPY.MANUAL_SATURATING_ARITHMETIC
|
Rust Clippy Lints |
`.checked_add/sub(x).unwrap_or(MAX/MIN)` |
3 |
False |
| RS.CLIPPY.MANUAL_SLICE_FILL
|
Rust Clippy Lints |
manually filling a slice with a value |
3 |
False |
| RS.CLIPPY.MANUAL_SLICE_SIZE_CALCULATION
|
Rust Clippy Lints |
manual slice size calculation |
3 |
False |
| RS.CLIPPY.MANUAL_SPLIT_ONCE
|
Rust Clippy Lints |
replace `.splitn(2, pat)` with `.split_once(pat)` |
3 |
False |
| RS.CLIPPY.MANUAL_STRING_NEW
|
Rust Clippy Lints |
empty String is being created manually |
3 |
False |
| RS.CLIPPY.MANUAL_STRIP
|
Rust Clippy Lints |
suggests using `strip_{prefix,suffix}` over `str::{starts,ends}_with` and slicing |
3 |
False |
| RS.CLIPPY.MANUAL_STR_REPEAT
|
Rust Clippy Lints |
manual implementation of `str::repeat` |
3 |
False |
| RS.CLIPPY.MANUAL_SWAP
|
Rust Clippy Lints |
manual swap of two variables |
3 |
False |
| RS.CLIPPY.MANUAL_TRY_FOLD
|
Rust Clippy Lints |
checks for usage of `Iterator::fold` with a type that implements `Try` |
3 |
False |
| RS.CLIPPY.MANUAL_UNWRAP_OR
|
Rust Clippy Lints |
finds patterns that can be encoded more concisely with `Option::unwrap_or` or `Result::unwrap_or` |
3 |
False |
| RS.CLIPPY.MANUAL_UNWRAP_OR_DEFAULT
|
Rust Clippy Lints |
check if a `match` or `if let` can be simplified with `unwrap_or_default` |
3 |
False |
| RS.CLIPPY.MANUAL_WHILE_LET_SOME
|
Rust Clippy Lints |
checking for emptiness of a `Vec` in the loop condition and popping an element in the body |
3 |
False |
| RS.CLIPPY.MANY_SINGLE_CHAR_NAMES
|
Rust Clippy Lints |
too many single character bindings |
3 |
False |
| RS.CLIPPY.MAP_ALL_ANY_IDENTITY
|
Rust Clippy Lints |
combine `.map(_)` followed by `.all(identity)`/`.any(identity)` into a single call |
3 |
False |
| RS.CLIPPY.MAP_CLONE
|
Rust Clippy Lints |
using `iterator.map(|x| x.clone())`, or dereferencing closures for `Copy` types |
3 |
False |
| RS.CLIPPY.MAP_COLLECT_RESULT_UNIT
|
Rust Clippy Lints |
using `.map(_).collect::<Result<(),_>()`, which can be replaced with `try_for_each` |
3 |
False |
| RS.CLIPPY.MAP_ENTRY
|
Rust Clippy Lints |
use of `contains_key` followed by `insert` on a `HashMap` or `BTreeMap` |
3 |
False |
| RS.CLIPPY.MAP_ERR_IGNORE
|
Rust Clippy Lints |
`map_err` should not ignore the original error |
3 |
False |
| RS.CLIPPY.MAP_FLATTEN
|
Rust Clippy Lints |
using combinations of `flatten` and `map` which can usually be written as a single method call |
3 |
False |
| RS.CLIPPY.MAP_IDENTITY
|
Rust Clippy Lints |
using iterator.map(|x| x) |
3 |
False |
| RS.CLIPPY.MAP_UNWRAP_OR
|
Rust Clippy Lints |
using `.map(f).unwrap_or(a)` or `.map(f).unwrap_or_else(func)`, which are more succinctly expressed as `map_or(a, f)` or `map_or_else(a,
f)`
|
3 |
False |
| RS.CLIPPY.MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES
|
Rust Clippy Lints |
map of a trivial closure (not dependent on parameter) over a range |
3 |
False |
| RS.CLIPPY.MATCH_AS_REF
|
Rust Clippy Lints |
a `match` on an Option value instead of using `as_ref()` or `as_mut` |
3 |
False |
| RS.CLIPPY.MATCH_BOOL
|
Rust Clippy Lints |
a `match` on a boolean expression instead of an `if..else` block |
3 |
False |
| RS.CLIPPY.MATCH_LIKE_MATCHES_MACRO
|
Rust Clippy Lints |
a match that could be written with the matches! macro |
3 |
False |
| RS.CLIPPY.MATCH_OVERLAPPING_ARM
|
Rust Clippy Lints |
a `match` with overlapping arms |
3 |
False |
| RS.CLIPPY.MATCH_REF_PATS
|
Rust Clippy Lints |
a `match` or `if let` with all arms prefixed with `&` instead of deref-ing the match expression |
3 |
False |
| RS.CLIPPY.MATCH_RESULT_OK
|
Rust Clippy Lints |
usage of `ok()` in `let Some(pat)` statements is unnecessary, match on `Ok(pat)` instead |
3 |
False |
| RS.CLIPPY.MATCH_SAME_ARMS
|
Rust Clippy Lints |
`match` with identical arm bodies |
3 |
False |
| RS.CLIPPY.MATCH_SINGLE_BINDING
|
Rust Clippy Lints |
a match with a single binding instead of using `let` statement |
3 |
False |
| RS.CLIPPY.MATCH_STR_CASE_MISMATCH
|
Rust Clippy Lints |
creation of a case altering match expression with non-compliant arms |
3 |
False |
| RS.CLIPPY.MATCH_WILDCARD_FOR_SINGLE_VARIANTS
|
Rust Clippy Lints |
a wildcard enum match for a single variant |
3 |
False |
| RS.CLIPPY.MATCH_WILD_ERR_ARM
|
Rust Clippy Lints |
a `match` with `Err(_)` arm and take drastic actions |
3 |
False |
| RS.CLIPPY.MAYBE_INFINITE_ITER
|
Rust Clippy Lints |
possible infinite iteration |
3 |
False |
| RS.CLIPPY.MEM_FORGET
|
Rust Clippy Lints |
`mem::forget` usage on `Drop` types, likely to cause memory leaks |
3 |
False |
| RS.CLIPPY.MEM_REPLACE_OPTION_WITH_NONE
|
Rust Clippy Lints |
replacing an `Option` with `None` instead of `take()` |
3 |
False |
| RS.CLIPPY.MEM_REPLACE_OPTION_WITH_SOME
|
Rust Clippy Lints |
replacing an `Option` with `Some` instead of `replace()` |
3 |
False |
| RS.CLIPPY.MEM_REPLACE_WITH_DEFAULT
|
Rust Clippy Lints |
replacing a value of type `T` with `T::default()` instead of using `std::mem::take` |
3 |
False |
| RS.CLIPPY.MEM_REPLACE_WITH_UNINIT
|
Rust Clippy Lints |
`mem::replace(&mut _, mem::uninitialized())` or `mem::replace(&mut _, mem::zeroed())` |
3 |
False |
| RS.CLIPPY.MIN_IDENT_CHARS
|
Rust Clippy Lints |
disallows idents that are too short |
3 |
False |
| RS.CLIPPY.MIN_MAX
|
Rust Clippy Lints |
`min(_, max(_, _))` (or vice versa) with bounds clamping the result to a constant |
3 |
False |
| RS.CLIPPY.MISMATCHING_TYPE_PARAM_ORDER
|
Rust Clippy Lints |
type parameter positioned inconsistently between type def and impl block |
3 |
False |
| RS.CLIPPY.MISNAMED_GETTERS
|
Rust Clippy Lints |
getter method returning the wrong field |
3 |
False |
| RS.CLIPPY.MISREFACTORED_ASSIGN_OP
|
Rust Clippy Lints |
having a variable on both sides of an assign op |
3 |
False |
| RS.CLIPPY.MISSING_ASSERTS_FOR_INDEXING
|
Rust Clippy Lints |
indexing into a slice multiple times without an `assert` |
3 |
False |
| RS.CLIPPY.MISSING_ASSERT_MESSAGE
|
Rust Clippy Lints |
checks assertions without a custom panic message |
3 |
False |
| RS.CLIPPY.MISSING_CONST_FOR_FN
|
Rust Clippy Lints |
Lint functions definitions that could be made `const fn` |
3 |
False |
| RS.CLIPPY.MISSING_CONST_FOR_THREAD_LOCAL
|
Rust Clippy Lints |
suggest using `const` in `thread_local!` macro |
3 |
False |
| RS.CLIPPY.MISSING_DOCS_IN_PRIVATE_ITEMS
|
Rust Clippy Lints |
detects missing documentation for private members |
3 |
False |
| RS.CLIPPY.MISSING_ENFORCED_IMPORT_RENAMES
|
Rust Clippy Lints |
enforce import renames |
3 |
False |
| RS.CLIPPY.MISSING_ERRORS_DOC
|
Rust Clippy Lints |
`pub fn` returns `Result` without `# Errors` in doc comment |
3 |
False |
| RS.CLIPPY.MISSING_FIELDS_IN_DEBUG
|
Rust Clippy Lints |
missing fields in manual `Debug` implementation |
3 |
False |
| RS.CLIPPY.MISSING_INLINE_IN_PUBLIC_ITEMS
|
Rust Clippy Lints |
detects missing `#[inline]` attribute for public callables (functions, trait methods, methods...) |
3 |
False |
| RS.CLIPPY.MISSING_PANICS_DOC
|
Rust Clippy Lints |
`pub fn` may panic without `# Panics` in doc comment |
3 |
False |
| RS.CLIPPY.MISSING_SAFETY_DOC
|
Rust Clippy Lints |
`pub unsafe fn` without `# Safety` docs |
3 |
False |
| RS.CLIPPY.MISSING_SPIN_LOOP
|
Rust Clippy Lints |
An empty busy waiting loop |
3 |
False |
| RS.CLIPPY.MISSING_TRAIT_METHODS
|
Rust Clippy Lints |
trait implementation uses default provided method |
3 |
False |
| RS.CLIPPY.MISSING_TRANSMUTE_ANNOTATIONS
|
Rust Clippy Lints |
warns if a transmute call doesn't have all generics specified |
3 |
False |
| RS.CLIPPY.MISTYPED_LITERAL_SUFFIXES
|
Rust Clippy Lints |
mistyped literal suffix |
3 |
False |
| RS.CLIPPY.MIXED_ATTRIBUTES_STYLE
|
Rust Clippy Lints |
item has both inner and outer attributes |
3 |
False |
| RS.CLIPPY.MIXED_CASE_HEX_LITERALS
|
Rust Clippy Lints |
hex literals whose letter digits are not consistently upper- or lowercased |
3 |
False |
| RS.CLIPPY.MIXED_READ_WRITE_IN_EXPRESSION
|
Rust Clippy Lints |
whether a variable read occurs before a write depends on sub-expression evaluation order |
3 |
False |
| RS.CLIPPY.MODULE_INCEPTION
|
Rust Clippy Lints |
modules that have the same name as their parent module |
3 |
False |
| RS.CLIPPY.MODULE_NAME_REPETITIONS
|
Rust Clippy Lints |
type names prefixed/postfixed with their containing module's name |
3 |
False |
| RS.CLIPPY.MODULO_ARITHMETIC
|
Rust Clippy Lints |
any modulo arithmetic statement |
3 |
False |
| RS.CLIPPY.MODULO_ONE
|
Rust Clippy Lints |
taking an integer modulo +/-1, which can either panic/overflow or always returns 0 |
3 |
False |
| RS.CLIPPY.MOD_MODULE_FILES
|
Rust Clippy Lints |
checks that module layout is consistent |
3 |
False |
| RS.CLIPPY.MULTIPLE_BOUND_LOCATIONS
|
Rust Clippy Lints |
defining generic bounds in multiple locations |
3 |
False |
| RS.CLIPPY.MULTIPLE_CRATE_VERSIONS
|
Rust Clippy Lints |
multiple versions of the same crate being used |
3 |
False |
| RS.CLIPPY.MULTIPLE_INHERENT_IMPL
|
Rust Clippy Lints |
Multiple inherent impl that could be grouped |
3 |
False |
| RS.CLIPPY.MULTIPLE_UNSAFE_OPS_PER_BLOCK
|
Rust Clippy Lints |
more than one unsafe operation per `unsafe` block |
3 |
False |
| RS.CLIPPY.MULTI_ASSIGNMENTS
|
Rust Clippy Lints |
instead of using `a = b = c;` use `a = c; b = c;` |
3 |
False |
| RS.CLIPPY.MUST_USE_CANDIDATE
|
Rust Clippy Lints |
function or method that could take a `#[must_use]` attribute |
3 |
False |
| RS.CLIPPY.MUST_USE_UNIT
|
Rust Clippy Lints |
`#[must_use]` attribute on a unit-returning function / method |
3 |
False |
| RS.CLIPPY.MUTABLE_KEY_TYPE
|
Rust Clippy Lints |
Check for mutable `Map`/`Set` key type |
3 |
False |
| RS.CLIPPY.MUTEX_ATOMIC
|
Rust Clippy Lints |
using a mutex where an atomic value could be used instead. |
3 |
False |
| RS.CLIPPY.MUTEX_INTEGER
|
Rust Clippy Lints |
using a mutex for an integer type |
3 |
False |
| RS.CLIPPY.MUT_FROM_REF
|
Rust Clippy Lints |
fns that create mutable refs from immutable ref args |
3 |
False |
| RS.CLIPPY.MUT_MUT
|
Rust Clippy Lints |
usage of double-mut refs, e.g., `&mut &mut ...` |
3 |
False |
| RS.CLIPPY.MUT_MUTEX_LOCK
|
Rust Clippy Lints |
`&mut Mutex::lock` does unnecessary locking |
3 |
False |
| RS.CLIPPY.MUT_RANGE_BOUND
|
Rust Clippy Lints |
for loop over a range where one of the bounds is a mutable variable |
3 |
False |
| RS.CLIPPY.NAIVE_BYTECOUNT
|
Rust Clippy Lints |
use of naive `<slice>.filter(|&x| x == y).count()` to count byte values |
3 |
False |
| RS.CLIPPY.NEEDLESS_ARBITRARY_SELF_TYPE
|
Rust Clippy Lints |
type of `self` parameter is already by default `Self` |
3 |
False |
| RS.CLIPPY.NEEDLESS_AS_BYTES
|
Rust Clippy Lints |
detect useless calls to `as_bytes()` |
3 |
False |
| RS.CLIPPY.NEEDLESS_BITWISE_BOOL
|
Rust Clippy Lints |
Boolean expressions that use bitwise rather than lazy operators |
3 |
False |
| RS.CLIPPY.NEEDLESS_BOOL
|
Rust Clippy Lints |
if-statements with plain booleans in the then- and else-clause, e.g., `if p { true } else { false }` |
3 |
False |
| RS.CLIPPY.NEEDLESS_BOOL_ASSIGN
|
Rust Clippy Lints |
setting the same boolean variable in both branches of an if-statement |
3 |
False |
| RS.CLIPPY.NEEDLESS_BORROW
|
Rust Clippy Lints |
taking a reference that is going to be automatically dereferenced |
3 |
False |
| RS.CLIPPY.NEEDLESS_BORROWED_REFERENCE
|
Rust Clippy Lints |
destructuring a reference and borrowing the inner value |
3 |
False |
| RS.CLIPPY.NEEDLESS_BORROWS_FOR_GENERIC_ARGS
|
Rust Clippy Lints |
taking a reference that is going to be automatically dereferenced |
3 |
False |
| RS.CLIPPY.NEEDLESS_CHARACTER_ITERATION
|
Rust Clippy Lints |
is_ascii() called on a char iterator |
3 |
False |
| RS.CLIPPY.NEEDLESS_COLLECT
|
Rust Clippy Lints |
collecting an iterator when collect is not needed |
3 |
False |
| RS.CLIPPY.NEEDLESS_CONTINUE
|
Rust Clippy Lints |
`continue` statements that can be replaced by a rearrangement of code |
3 |
False |
| RS.CLIPPY.NEEDLESS_DOCTEST_MAIN
|
Rust Clippy Lints |
presence of `fn main() {` in code examples |
3 |
False |
| RS.CLIPPY.NEEDLESS_ELSE
|
Rust Clippy Lints |
empty else branch |
3 |
False |
| RS.CLIPPY.NEEDLESS_FOR_EACH
|
Rust Clippy Lints |
using `for_each` where a `for` loop would be simpler |
3 |
False |
| RS.CLIPPY.NEEDLESS_IF
|
Rust Clippy Lints |
checks for empty if branches |
3 |
False |
| RS.CLIPPY.NEEDLESS_LATE_INIT
|
Rust Clippy Lints |
late initializations that can be replaced by a `let` statement with an initializer |
3 |
False |
| RS.CLIPPY.NEEDLESS_LIFETIMES
|
Rust Clippy Lints |
would allow omitting them |
3 |
False |
| RS.CLIPPY.NEEDLESS_MATCH
|
Rust Clippy Lints |
`match` or match-like `if let` that are unnecessary |
3 |
False |
| RS.CLIPPY.NEEDLESS_MAYBE_SIZED
|
Rust Clippy Lints |
a `?Sized` bound that is unusable due to a `Sized` requirement |
3 |
False |
| RS.CLIPPY.NEEDLESS_OPTION_AS_DEREF
|
Rust Clippy Lints |
no-op use of `deref` or `deref_mut` method to `Option`. |
3 |
False |
| RS.CLIPPY.NEEDLESS_OPTION_TAKE
|
Rust Clippy Lints |
using `.as_ref().take()` on a temporary value |
3 |
False |
| RS.CLIPPY.NEEDLESS_PARENS_ON_RANGE_LITERALS
|
Rust Clippy Lints |
needless parenthesis on range literals can be removed |
3 |
False |
| RS.CLIPPY.NEEDLESS_PASS_BY_REF_MUT
|
Rust Clippy Lints |
using a `&mut` argument when it's not mutated |
3 |
False |
| RS.CLIPPY.NEEDLESS_PASS_BY_VALUE
|
Rust Clippy Lints |
functions taking arguments by value, but not consuming them in its body |
3 |
False |
| RS.CLIPPY.NEEDLESS_PUB_SELF
|
Rust Clippy Lints |
checks for usage of `pub(self)` and `pub(in self)`. |
3 |
False |
| RS.CLIPPY.NEEDLESS_QUESTION_MARK
|
Rust Clippy Lints |
using `Ok(x?)` or `Some(x?)` where `x` would be equivalent |
3 |
False |
| RS.CLIPPY.NEEDLESS_RANGE_LOOP
|
Rust Clippy Lints |
for-looping over a range of indices where an iterator over items would do |
3 |
False |
| RS.CLIPPY.NEEDLESS_RAW_STRINGS
|
Rust Clippy Lints |
suggests using a string literal when a raw string literal is unnecessary |
3 |
False |
| RS.CLIPPY.NEEDLESS_RAW_STRING_HASHES
|
Rust Clippy Lints |
suggests reducing the number of hashes around a raw string literal |
3 |
False |
| RS.CLIPPY.NEEDLESS_RETURN
|
Rust Clippy Lints |
using a return statement like `return expr;` where an expression would suffice |
3 |
False |
| RS.CLIPPY.NEEDLESS_RETURN_WITH_QUESTION_MARK
|
Rust Clippy Lints |
using a return statement like `return Err(expr)?;` where removing it would suffice |
3 |
False |
| RS.CLIPPY.NEEDLESS_SPLITN
|
Rust Clippy Lints |
usages of `str::splitn` that can be replaced with `str::split` |
3 |
False |
| RS.CLIPPY.NEEDLESS_UPDATE
|
Rust Clippy Lints |
using `Foo { ..base }` when there are no missing fields |
3 |
False |
| RS.CLIPPY.NEGATIVE_FEATURE_NAMES
|
Rust Clippy Lints |
usage of a negative feature name |
3 |
False |
| RS.CLIPPY.NEG_CMP_OP_ON_PARTIAL_ORD
|
Rust Clippy Lints |
The use of negated comparison operators on partially ordered types may produce confusing code. |
3 |
False |
| RS.CLIPPY.NEG_MULTIPLY
|
Rust Clippy Lints |
multiplying integers by `-1` |
3 |
False |
| RS.CLIPPY.NEVER_LOOP
|
Rust Clippy Lints |
any loop that will always `break` or `return` |
3 |
False |
| RS.CLIPPY.NEW_RET_NO_SELF
|
Rust Clippy Lints |
not returning type containing `Self` in a `new` method |
3 |
False |
| RS.CLIPPY.NEW_WITHOUT_DEFAULT
|
Rust Clippy Lints |
`pub fn new() -> Self` method without `Default` implementation |
3 |
False |
| RS.CLIPPY.NONMINIMAL_BOOL
|
Rust Clippy Lints |
boolean expressions that can be written more concisely |
3 |
False |
| RS.CLIPPY.NONSENSICAL_OPEN_OPTIONS
|
Rust Clippy Lints |
nonsensical combination of options for opening a file |
3 |
False |
| RS.CLIPPY.NONSTANDARD_MACRO_BRACES
|
Rust Clippy Lints |
check consistent use of braces in macro |
3 |
False |
| RS.CLIPPY.NON_ASCII_LITERAL
|
Rust Clippy Lints |
using any literal non-ASCII chars in a string literal instead of using the `\\u` escape |
3 |
False |
| RS.CLIPPY.NON_CANONICAL_CLONE_IMPL
|
Rust Clippy Lints |
non-canonical implementation of `Clone` on a `Copy` type |
3 |
False |
| RS.CLIPPY.NON_CANONICAL_PARTIAL_ORD_IMPL
|
Rust Clippy Lints |
non-canonical implementation of `PartialOrd` on an `Ord` type |
3 |
False |
| RS.CLIPPY.NON_MINIMAL_CFG
|
Rust Clippy Lints |
ensure that all `cfg(any())` and `cfg(all())` have more than one condition |
3 |
False |
| RS.CLIPPY.NON_OCTAL_UNIX_PERMISSIONS
|
Rust Clippy Lints |
use of non-octal value to set unix file permissions, which will be translated into octal |
3 |
False |
| RS.CLIPPY.NON_SEND_FIELDS_IN_SEND_TY
|
Rust Clippy Lints |
there is a field that is not safe to be sent to another thread in a `Send` struct |
3 |
False |
| RS.CLIPPY.NON_STD_LAZY_STATICS
|
Rust Clippy Lints |
lazy static that could be replaced by `std::sync::LazyLock` |
3 |
False |
| RS.CLIPPY.NON_ZERO_SUGGESTIONS
|
Rust Clippy Lints |
suggests using `NonZero#` from `u#` or `i#` for more efficient and type-safe conversions |
3 |
False |
| RS.CLIPPY.NOT_UNSAFE_PTR_ARG_DEREF
|
Rust Clippy Lints |
public functions dereferencing raw pointer arguments but not marked `unsafe` |
3 |
False |
| RS.CLIPPY.NO_EFFECT
|
Rust Clippy Lints |
statements with no effect |
3 |
False |
| RS.CLIPPY.NO_EFFECT_REPLACE
|
Rust Clippy Lints |
replace with no effect |
3 |
False |
| RS.CLIPPY.NO_EFFECT_UNDERSCORE_BINDING
|
Rust Clippy Lints |
binding to `_` prefixed variable with no side-effect |
3 |
False |
| RS.CLIPPY.NO_MANGLE_WITH_RUST_ABI
|
Rust Clippy Lints |
convert Rust ABI functions to C ABI |
3 |
False |
| RS.CLIPPY.OBFUSCATED_IF_ELSE
|
Rust Clippy Lints |
more clearly with `if .. else ..` |
3 |
False |
| RS.CLIPPY.OCTAL_ESCAPES
|
Rust Clippy Lints |
string escape sequences looking like octal characters |
3 |
False |
| RS.CLIPPY.OK_EXPECT
|
Rust Clippy Lints |
using `ok().expect()`, which gives worse error messages than calling `expect` directly on the Result |
3 |
False |
| RS.CLIPPY.ONLY_USED_IN_RECURSION
|
Rust Clippy Lints |
arguments that is only used in recursion can be removed |
3 |
False |
| RS.CLIPPY.OPTION_AS_REF_CLONED
|
Rust Clippy Lints |
cloning an `Option` via `as_ref().cloned()` |
3 |
False |
| RS.CLIPPY.OPTION_AS_REF_DEREF
|
Rust Clippy Lints |
using `as_ref().map(Deref::deref)`, which is more succinctly expressed as `as_deref()` |
3 |
False |
| RS.CLIPPY.OPTION_ENV_UNWRAP
|
Rust Clippy Lints |
using `option_env!(...).unwrap()` to get environment variable |
3 |
False |
| RS.CLIPPY.OPTION_FILTER_MAP
|
Rust Clippy Lints |
filtering `Option` for `Some` then force-unwrapping, which can be one type-safe operation |
3 |
False |
| RS.CLIPPY.OPTION_IF_LET_ELSE
|
Rust Clippy Lints |
reimplementation of Option::map_or |
3 |
False |
| RS.CLIPPY.OPTION_MAP_OR_NONE
|
Rust Clippy Lints |
using `Option.map_or(None, f)`, which is more succinctly expressed as `and_then(f)` |
3 |
False |
| RS.CLIPPY.OPTION_MAP_UNIT_FN
|
Rust Clippy Lints |
using `option.map(f)`, where `f` is a function or closure that returns `()` |
3 |
False |
| RS.CLIPPY.OPTION_OPTION
|
Rust Clippy Lints |
usage of `Option<Option<T>>` |
3 |
False |
| RS.CLIPPY.OP_REF
|
Rust Clippy Lints |
taking a reference to satisfy the type constraints on `==` |
3 |
False |
| RS.CLIPPY.OR_FUN_CALL
|
Rust Clippy Lints |
using any `*or` method with a function call, which suggests `*or_else` |
3 |
False |
| RS.CLIPPY.OR_THEN_UNWRAP
|
Rust Clippy Lints |
checks for `.or(…).unwrap()` calls to Options and Results. |
3 |
False |
| RS.CLIPPY.OUT_OF_BOUNDS_INDEXING
|
Rust Clippy Lints |
out of bounds constant indexing |
3 |
False |
| RS.CLIPPY.OVERLY_COMPLEX_BOOL_EXPR
|
Rust Clippy Lints |
boolean expressions that contain terminals which can be eliminated |
3 |
False |
| RS.CLIPPY.OWNED_COW
|
Rust Clippy Lints |
needlessly owned Cow type |
3 |
False |
| RS.CLIPPY.PANIC
|
Rust Clippy Lints |
usage of the `panic!` macro |
3 |
False |
| RS.CLIPPY.PANICKING_OVERFLOW_CHECKS
|
Rust Clippy Lints |
overflow checks which will panic in debug mode |
3 |
False |
| RS.CLIPPY.PANICKING_UNWRAP
|
Rust Clippy Lints |
checks for calls of `unwrap[_err]()` that will always fail |
3 |
False |
| RS.CLIPPY.PANIC_IN_RESULT_FN
|
Rust Clippy Lints |
functions of type `Result<..>` that contain `panic!()` or assertion |
3 |
False |
| RS.CLIPPY.PARTIALEQ_NE_IMPL
|
Rust Clippy Lints |
re-implementing `PartialEq::ne` |
3 |
False |
| RS.CLIPPY.PARTIALEQ_TO_NONE
|
Rust Clippy Lints |
Binary comparison to `Option<T>::None` relies on `T: PartialEq`, which is unneeded |
3 |
False |
| RS.CLIPPY.PARTIAL_PUB_FIELDS
|
Rust Clippy Lints |
partial fields of a struct are public |
3 |
False |
| RS.CLIPPY.PATHBUF_INIT_THEN_PUSH
|
Rust Clippy Lints |
`push` immediately after `PathBuf` creation |
3 |
False |
| RS.CLIPPY.PATH_BUF_PUSH_OVERWRITE
|
Rust Clippy Lints |
calling `push` with file system root on `PathBuf` can overwrite it |
3 |
False |
| RS.CLIPPY.PATH_ENDS_WITH_EXT
|
Rust Clippy Lints |
attempting to compare file extensions using `Path::ends_with` |
3 |
False |
| RS.CLIPPY.PATTERN_TYPE_MISMATCH
|
Rust Clippy Lints |
type of pattern does not match the expression type |
3 |
False |
| RS.CLIPPY.PERMISSIONS_SET_READONLY_FALSE
|
Rust Clippy Lints |
Checks for calls to `std::fs::Permissions.set_readonly` with argument `false` |
3 |
False |
| RS.CLIPPY.POINTERS_IN_NOMEM_ASM_BLOCK
|
Rust Clippy Lints |
pointers in nomem asm block |
3 |
False |
| RS.CLIPPY.POINTER_FORMAT
|
Rust Clippy Lints |
formatting a pointer |
3 |
False |
| RS.CLIPPY.POSSIBLE_MISSING_COMMA
|
Rust Clippy Lints |
possible missing comma in array |
3 |
False |
| RS.CLIPPY.PRECEDENCE
|
Rust Clippy Lints |
operations where precedence may be unclear |
3 |
False |
| RS.CLIPPY.PRECEDENCE_BITS
|
Rust Clippy Lints |
operations mixing bit shifting with bit combining/masking |
3 |
False |
| RS.CLIPPY.PRINTLN_EMPTY_STRING
|
Rust Clippy Lints |
using `println!(\"\")` with an empty string |
3 |
False |
| RS.CLIPPY.PRINT_IN_FORMAT_IMPL
|
Rust Clippy Lints |
use of a print macro in a formatting trait impl |
3 |
False |
| RS.CLIPPY.PRINT_LITERAL
|
Rust Clippy Lints |
printing a literal with a format string |
3 |
False |
| RS.CLIPPY.PRINT_STDERR
|
Rust Clippy Lints |
printing on stderr |
3 |
False |
| RS.CLIPPY.PRINT_STDOUT
|
Rust Clippy Lints |
printing on stdout |
3 |
False |
| RS.CLIPPY.PRINT_WITH_NEWLINE
|
Rust Clippy Lints |
using `print!()` with a format string that ends in a single newline |
3 |
False |
| RS.CLIPPY.PTR_ARG
|
Rust Clippy Lints |
fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` instead, respectively |
3 |
False |
| RS.CLIPPY.PTR_AS_PTR
|
Rust Clippy Lints |
casting using `as` between raw pointers that doesn't change their constness, where `pointer::cast` could take the place of
`as`
|
3 |
False |
| RS.CLIPPY.PTR_CAST_CONSTNESS
|
Rust Clippy Lints |
casting using `as` on raw pointers to change constness when specialized methods apply |
3 |
False |
| RS.CLIPPY.PTR_EQ
|
Rust Clippy Lints |
use `std::ptr::eq` when comparing raw pointers |
3 |
False |
| RS.CLIPPY.PTR_OFFSET_WITH_CAST
|
Rust Clippy Lints |
unneeded pointer offset cast |
3 |
False |
| RS.CLIPPY.PUB_UNDERSCORE_FIELDS
|
Rust Clippy Lints |
struct field prefixed with underscore and marked public |
3 |
False |
| RS.CLIPPY.PUB_USE
|
Rust Clippy Lints |
restricts the usage of `pub use` |
3 |
False |
| RS.CLIPPY.PUB_WITHOUT_SHORTHAND
|
Rust Clippy Lints |
disallows usage of `pub(in <loc>)` with `in` |
3 |
False |
| RS.CLIPPY.PUB_WITH_SHORTHAND
|
Rust Clippy Lints |
disallows usage of `pub(<loc>)`, without `in` |
3 |
False |
| RS.CLIPPY.QUESTION_MARK
|
Rust Clippy Lints |
checks for expressions that could be replaced by the `?` operator |
3 |
False |
| RS.CLIPPY.QUESTION_MARK_USED
|
Rust Clippy Lints |
checks if the `?` operator is used |
3 |
False |
| RS.CLIPPY.RANGE_MINUS_ONE
|
Rust Clippy Lints |
`x..=(y-1)` reads better as `x..y` |
3 |
False |
| RS.CLIPPY.RANGE_PLUS_ONE
|
Rust Clippy Lints |
`x..(y+1)` reads better as `x..=y` |
3 |
False |
| RS.CLIPPY.RANGE_ZIP_WITH_LEN
|
Rust Clippy Lints |
zipping iterator with a range when `enumerate()` would do |
3 |
False |
| RS.CLIPPY.RC_BUFFER
|
Rust Clippy Lints |
shared ownership of a buffer type |
3 |
False |
| RS.CLIPPY.RC_CLONE_IN_VEC_INIT
|
Rust Clippy Lints |
initializing reference-counted pointer in `vec![elem; len]` |
3 |
False |
| RS.CLIPPY.RC_MUTEX
|
Rust Clippy Lints |
usage of `Rc<Mutex<T>>` |
3 |
False |
| RS.CLIPPY.READONLY_WRITE_LOCK
|
Rust Clippy Lints |
acquiring a write lock when a read lock would work |
3 |
False |
| RS.CLIPPY.READ_LINE_WITHOUT_TRIM
|
Rust Clippy Lints |
calling `Stdin::read_line`, then trying to parse it without first trimming |
3 |
False |
| RS.CLIPPY.READ_ZERO_BYTE_VEC
|
Rust Clippy Lints |
checks for reads into a zero-length `Vec` |
3 |
False |
| RS.CLIPPY.RECURSIVE_FORMAT_IMPL
|
Rust Clippy Lints |
Format trait method called while implementing the same Format trait |
3 |
False |
| RS.CLIPPY.REDUNDANT_ALLOCATION
|
Rust Clippy Lints |
redundant allocation |
3 |
False |
| RS.CLIPPY.REDUNDANT_ASYNC_BLOCK
|
Rust Clippy Lints |
`async { future.await }` can be replaced by `future` |
3 |
False |
| RS.CLIPPY.REDUNDANT_AS_STR
|
Rust Clippy Lints |
`as_str` used to call a method on `str` that is also available on `String` |
3 |
False |
| RS.CLIPPY.REDUNDANT_AT_REST_PATTERN
|
Rust Clippy Lints |
checks for `[all @ ..]` where `all` would suffice |
3 |
False |
| RS.CLIPPY.REDUNDANT_CLONE
|
Rust Clippy Lints |
`clone()` of an owned value that is going to be dropped immediately |
3 |
False |
| RS.CLIPPY.REDUNDANT_CLOSURE
|
Rust Clippy Lints |
redundant closures, i.e., `|a| foo(a)` (which can be written as just `foo`) |
3 |
False |
| RS.CLIPPY.REDUNDANT_CLOSURE_CALL
|
Rust Clippy Lints |
throwaway closures called in the expression they are defined |
3 |
False |
| RS.CLIPPY.REDUNDANT_CLOSURE_FOR_METHOD_CALLS
|
Rust Clippy Lints |
redundant closures for method calls |
3 |
False |
| RS.CLIPPY.REDUNDANT_COMPARISONS
|
Rust Clippy Lints |
double comparisons where one of them can be removed |
3 |
False |
| RS.CLIPPY.REDUNDANT_ELSE
|
Rust Clippy Lints |
`else` branch that can be removed without changing semantics |
3 |
False |
| RS.CLIPPY.REDUNDANT_FEATURE_NAMES
|
Rust Clippy Lints |
usage of a redundant feature name |
3 |
False |
| RS.CLIPPY.REDUNDANT_FIELD_NAMES
|
Rust Clippy Lints |
checks for fields in struct literals where shorthands could be used |
3 |
False |
| RS.CLIPPY.REDUNDANT_GUARDS
|
Rust Clippy Lints |
checks for unnecessary guards in match expressions |
3 |
False |
| RS.CLIPPY.REDUNDANT_LOCALS
|
Rust Clippy Lints |
redundant redefinition of a local binding |
3 |
False |
| RS.CLIPPY.REDUNDANT_PATTERN
|
Rust Clippy Lints |
using `name @ _` in a pattern |
3 |
False |
| RS.CLIPPY.REDUNDANT_PATTERN_MATCHING
|
Rust Clippy Lints |
use the proper utility function avoiding an `if let` |
3 |
False |
| RS.CLIPPY.REDUNDANT_PUB_CRATE
|
Rust Clippy Lints |
Using `pub(crate)` visibility on items that are not crate visible due to the visibility of the module that contains them. |
3 |
False |
| RS.CLIPPY.REDUNDANT_SLICING
|
Rust Clippy Lints |
redundant slicing of the whole range of a type |
3 |
False |
| RS.CLIPPY.REDUNDANT_STATIC_LIFETIMES
|
Rust Clippy Lints |
Using explicit `'static` lifetime for constants or statics when elision rules would allow omitting them. |
3 |
False |
| RS.CLIPPY.REDUNDANT_TEST_PREFIX
|
Rust Clippy Lints |
redundant `test_` prefix in test function name |
3 |
False |
| RS.CLIPPY.REDUNDANT_TYPE_ANNOTATIONS
|
Rust Clippy Lints |
warns about needless / redundant type annotations. |
3 |
False |
| RS.CLIPPY.REF_AS_PTR
|
Rust Clippy Lints |
using `as` to cast a reference to pointer |
3 |
False |
| RS.CLIPPY.REF_BINDING_TO_REFERENCE
|
Rust Clippy Lints |
`ref` binding to a reference |
3 |
False |
| RS.CLIPPY.REF_OPTION
|
Rust Clippy Lints |
function signature uses `&Option<T>` instead of `Option<&T>` |
3 |
False |
| RS.CLIPPY.REF_OPTION_REF
|
Rust Clippy Lints |
use `Option<&T>` instead of `&Option<&T>` |
3 |
False |
| RS.CLIPPY.REF_PATTERNS
|
Rust Clippy Lints |
use of a ref pattern, e.g. Some(ref value) |
3 |
False |
| RS.CLIPPY.REGEX_CREATION_IN_LOOPS
|
Rust Clippy Lints |
regular expression compilation performed in a loop |
3 |
False |
| RS.CLIPPY.RENAMED_FUNCTION_PARAMS
|
Rust Clippy Lints |
renamed function parameters in trait implementation |
3 |
False |
| RS.CLIPPY.REPEAT_ONCE
|
Rust Clippy Lints |
using `.repeat(1)` instead of `String.clone()`, `str.to_string()` or `slice.to_vec()` |
3 |
False |
| RS.CLIPPY.REPEAT_VEC_WITH_CAPACITY
|
Rust Clippy Lints |
repeating a `Vec::with_capacity` expression which does not retain capacity |
3 |
False |
| RS.CLIPPY.REPR_PACKED_WITHOUT_ABI
|
Rust Clippy Lints |
ensures that `repr(packed)` always comes with a qualified ABI |
3 |
False |
| RS.CLIPPY.RESERVE_AFTER_INITIALIZATION
|
Rust Clippy Lints |
`reserve` called immediately after `Vec` creation |
3 |
False |
| RS.CLIPPY.REST_PAT_IN_FULLY_BOUND_STRUCTS
|
Rust Clippy Lints |
a match on a struct that binds all fields but still uses the wildcard pattern |
3 |
False |
| RS.CLIPPY.RESULT_FILTER_MAP
|
Rust Clippy Lints |
filtering `Result` for `Ok` then force-unwrapping, which can be one type-safe operation |
3 |
False |
| RS.CLIPPY.RESULT_LARGE_ERR
|
Rust Clippy Lints |
function returning `Result` with large `Err` type |
3 |
False |
| RS.CLIPPY.RESULT_MAP_OR_INTO_OPTION
|
Rust Clippy Lints |
using `Result.map_or(None, Some)`, which is more succinctly expressed as `ok()` |
3 |
False |
| RS.CLIPPY.RESULT_MAP_UNIT_FN
|
Rust Clippy Lints |
using `result.map(f)`, where `f` is a function or closure that returns `()` |
3 |
False |
| RS.CLIPPY.RESULT_UNIT_ERR
|
Rust Clippy Lints |
public function returning `Result` with an `Err` type of `()` |
3 |
False |
| RS.CLIPPY.RETURN_AND_THEN
|
Rust Clippy Lints |
using `Option::and_then` or `Result::and_then` to chain a computation that returns an `Option` or a `Result` |
3 |
False |
| RS.CLIPPY.RETURN_SELF_NOT_MUST_USE
|
Rust Clippy Lints |
missing `#[must_use]` annotation on a method returning `Self` |
3 |
False |
| RS.CLIPPY.REVERSED_EMPTY_RANGES
|
Rust Clippy Lints |
reversing the limits of range expressions, resulting in empty ranges |
3 |
False |
| RS.CLIPPY.SAME_FUNCTIONS_IN_IF_CONDITION
|
Rust Clippy Lints |
consecutive `if`s with the same function call |
3 |
False |
| RS.CLIPPY.SAME_ITEM_PUSH
|
Rust Clippy Lints |
the same item is pushed inside of a for loop |
3 |
False |
| RS.CLIPPY.SAME_NAME_METHOD
|
Rust Clippy Lints |
two method with same name |
3 |
False |
| RS.CLIPPY.SEARCH_IS_SOME
|
Rust Clippy Lints |
using an iterator or string search followed by `is_some()` or `is_none()`, which is more succinctly expressed as a call to
`any()` or `contains()` (with negation in case of `is_none()`)
|
3 |
False |
| RS.CLIPPY.SEEK_FROM_CURRENT
|
Rust Clippy Lints |
use dedicated method for seek from current position |
3 |
False |
| RS.CLIPPY.SEEK_TO_START_INSTEAD_OF_REWIND
|
Rust Clippy Lints |
jumping to the start of stream using `seek` method |
3 |
False |
| RS.CLIPPY.SELF_ASSIGNMENT
|
Rust Clippy Lints |
explicit self-assignment |
3 |
False |
| RS.CLIPPY.SELF_NAMED_CONSTRUCTORS
|
Rust Clippy Lints |
method should not have the same name as the type it is implemented for |
3 |
False |
| RS.CLIPPY.SELF_NAMED_MODULE_FILES
|
Rust Clippy Lints |
checks that module layout is consistent |
3 |
False |
| RS.CLIPPY.SEMICOLON_IF_NOTHING_RETURNED
|
Rust Clippy Lints |
add a semicolon if nothing is returned |
3 |
False |
| RS.CLIPPY.SEMICOLON_INSIDE_BLOCK
|
Rust Clippy Lints |
add a semicolon inside the block |
3 |
False |
| RS.CLIPPY.SEMICOLON_OUTSIDE_BLOCK
|
Rust Clippy Lints |
add a semicolon outside the block |
3 |
False |
| RS.CLIPPY.SEPARATED_LITERAL_SUFFIX
|
Rust Clippy Lints |
literals whose suffix is separated by an underscore |
3 |
False |
| RS.CLIPPY.SERDE_API_MISUSE
|
Rust Clippy Lints |
various things that will negatively affect your serde experience |
3 |
False |
| RS.CLIPPY.SET_CONTAINS_OR_INSERT
|
Rust Clippy Lints |
call to `<set>::contains` followed by `<set>::insert` |
3 |
False |
| RS.CLIPPY.SHADOW_REUSE
|
Rust Clippy Lints |
rebinding a name to an expression that reuses the original value, e.g., `let x = x + 1` |
3 |
False |
| RS.CLIPPY.SHADOW_SAME
|
Rust Clippy Lints |
rebinding a name to itself, e.g., `let mut x = &mut x` |
3 |
False |
| RS.CLIPPY.SHADOW_UNRELATED
|
Rust Clippy Lints |
rebinding a name without even using the original value |
3 |
False |
| RS.CLIPPY.SHORT_CIRCUIT_STATEMENT
|
Rust Clippy Lints |
using a short circuit boolean condition as a statement |
3 |
False |
| RS.CLIPPY.SHOULD_IMPLEMENT_TRAIT
|
Rust Clippy Lints |
defining a method that should be implementing a std trait |
3 |
False |
| RS.CLIPPY.SHOULD_PANIC_WITHOUT_EXPECT
|
Rust Clippy Lints |
ensures that all `should_panic` attributes specify its expected panic message |
3 |
False |
| RS.CLIPPY.SIGNIFICANT_DROP_IN_SCRUTINEE
|
Rust Clippy Lints |
warns when a temporary of a type with a drop with a significant side-effect might have a surprising lifetime |
3 |
False |
| RS.CLIPPY.SIGNIFICANT_DROP_TIGHTENING
|
Rust Clippy Lints |
Searches for elements marked with `#[clippy::has_significant_drop]` that could be early dropped but are in fact dropped at
the end of their scopes
|
3 |
False |
| RS.CLIPPY.SIMILAR_NAMES
|
Rust Clippy Lints |
similarly named items and bindings |
3 |
False |
| RS.CLIPPY.SINGLE_CALL_FN
|
Rust Clippy Lints |
checks for functions that are only used once |
3 |
False |
| RS.CLIPPY.SINGLE_CHAR_ADD_STR
|
Rust Clippy Lints |
`push_str()` or `insert_str()` used with a single-character string literal as parameter |
3 |
False |
| RS.CLIPPY.SINGLE_CHAR_LIFETIME_NAMES
|
Rust Clippy Lints |
warns against single-character lifetime names |
3 |
False |
| RS.CLIPPY.SINGLE_CHAR_PATTERN
|
Rust Clippy Lints |
using a single-character str where a char could be used, e.g., `_.split(\"x\")` |
3 |
False |
| RS.CLIPPY.SINGLE_COMPONENT_PATH_IMPORTS
|
Rust Clippy Lints |
imports with single component path are redundant |
3 |
False |
| RS.CLIPPY.SINGLE_ELEMENT_LOOP
|
Rust Clippy Lints |
there is no reason to have a single element loop |
3 |
False |
| RS.CLIPPY.SINGLE_MATCH
|
Rust Clippy Lints |
a `match` statement with a single nontrivial arm (i.e., where the other arm is `_ => {}`) instead of `if let` |
3 |
False |
| RS.CLIPPY.SINGLE_MATCH_ELSE
|
Rust Clippy Lints |
a `match` statement with two arms where the second arm's pattern is a placeholder instead of a specific match pattern |
3 |
False |
| RS.CLIPPY.SINGLE_OPTION_MAP
|
Rust Clippy Lints |
Checks for functions with method calls to `.map(_)` on an arg of type `Option` as the outermost expression. |
3 |
False |
| RS.CLIPPY.SINGLE_RANGE_IN_VEC_INIT
|
Rust Clippy Lints |
checks for initialization of `Vec` or arrays which consist of a single range |
3 |
False |
| RS.CLIPPY.SIZE_OF_IN_ELEMENT_COUNT
|
Rust Clippy Lints |
using `size_of::<T>` or `size_of_val::<T>` where a count of elements of `T` is expected |
3 |
False |
| RS.CLIPPY.SIZE_OF_REF
|
Rust Clippy Lints |
Argument to `size_of_val()` is a double-reference, which is almost certainly unintended |
3 |
False |
| RS.CLIPPY.SKIP_WHILE_NEXT
|
Rust Clippy Lints |
using `skip_while(p).next()`, which is more succinctly expressed as `.find(!p)` |
3 |
False |
| RS.CLIPPY.SLICED_STRING_AS_BYTES
|
Rust Clippy Lints |
slicing a string and immediately calling as_bytes is less efficient and can lead to panics |
3 |
False |
| RS.CLIPPY.SLOW_VECTOR_INITIALIZATION
|
Rust Clippy Lints |
slow vector initialization |
3 |
False |
| RS.CLIPPY.STABLE_SORT_PRIMITIVE
|
Rust Clippy Lints |
use of sort() when sort_unstable() is equivalent |
3 |
False |
| RS.CLIPPY.STD_INSTEAD_OF_ALLOC
|
Rust Clippy Lints |
type is imported from std when available in alloc |
3 |
False |
| RS.CLIPPY.STD_INSTEAD_OF_CORE
|
Rust Clippy Lints |
type is imported from std when available in core |
3 |
False |
| RS.CLIPPY.STRING_ADD
|
Rust Clippy Lints |
using `x + ..` where x is a `String` instead of `push_str()` |
3 |
False |
| RS.CLIPPY.STRING_ADD_ASSIGN
|
Rust Clippy Lints |
using `x = x + ..` where x is a `String` instead of `push_str()` |
3 |
False |
| RS.CLIPPY.STRING_EXTEND_CHARS
|
Rust Clippy Lints |
using `x.extend(s.chars())` where s is a `&str` or `String` |
3 |
False |
| RS.CLIPPY.STRING_FROM_UTF8_AS_BYTES
|
Rust Clippy Lints |
casting string slices to byte slices and back |
3 |
False |
| RS.CLIPPY.STRING_LIT_AS_BYTES
|
Rust Clippy Lints |
calling `as_bytes` on a string literal instead of using a byte string literal |
3 |
False |
| RS.CLIPPY.STRING_LIT_CHARS_ANY
|
Rust Clippy Lints |
checks for `<string_lit>.chars().any(|i| i == c)` |
3 |
False |
| RS.CLIPPY.STRING_SLICE
|
Rust Clippy Lints |
slicing a string |
3 |
False |
| RS.CLIPPY.STRING_TO_STRING
|
Rust Clippy Lints |
using `to_string()` on a `String`, which should be `clone()` |
3 |
False |
| RS.CLIPPY.STRLEN_ON_C_STRINGS
|
Rust Clippy Lints |
using `libc::strlen` on a `CString` or `CStr` value, while `as_bytes().len()` or `to_bytes().len()` respectively can be used
instead
|
3 |
False |
| RS.CLIPPY.STRUCT_EXCESSIVE_BOOLS
|
Rust Clippy Lints |
using too many bools in a struct |
3 |
False |
| RS.CLIPPY.STRUCT_FIELD_NAMES
|
Rust Clippy Lints |
structs where all fields share a prefix/postfix or contain the name of the struct |
3 |
False |
| RS.CLIPPY.STR_SPLIT_AT_NEWLINE
|
Rust Clippy Lints |
splitting a trimmed string at hard-coded newlines |
3 |
False |
| RS.CLIPPY.STR_TO_STRING
|
Rust Clippy Lints |
using `to_string()` on a `&str`, which should be `to_owned()` |
3 |
False |
| RS.CLIPPY.SUBOPTIMAL_FLOPS
|
Rust Clippy Lints |
usage of sub-optimal floating point operations |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_ARITHMETIC_IMPL
|
Rust Clippy Lints |
suspicious use of operators in impl of arithmetic trait |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_ASSIGNMENT_FORMATTING
|
Rust Clippy Lints |
suspicious formatting of `*=`, `-=` or `!=` |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_COMMAND_ARG_SPACE
|
Rust Clippy Lints |
single command line argument that looks like it should be multiple arguments |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_DOC_COMMENTS
|
Rust Clippy Lints |
suspicious usage of (outer) doc comments |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_ELSE_FORMATTING
|
Rust Clippy Lints |
suspicious formatting of `else` |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_MAP
|
Rust Clippy Lints |
suspicious usage of map |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_OPEN_OPTIONS
|
Rust Clippy Lints |
suspicious combination of options for opening a file |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_OPERATION_GROUPINGS
|
Rust Clippy Lints |
groupings of binary operations that look suspiciously like typos |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_OP_ASSIGN_IMPL
|
Rust Clippy Lints |
suspicious use of operators in impl of OpAssign trait |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_SPLITN
|
Rust Clippy Lints |
checks for `.splitn(0, ..)` and `.splitn(1, ..)` |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_TO_OWNED
|
Rust Clippy Lints |
calls to `to_owned` on a `Cow<'_, _>` might not do what they are expected |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_UNARY_OP_FORMATTING
|
Rust Clippy Lints |
suspicious formatting of unary `-` or `!` on the RHS of a BinOp |
3 |
False |
| RS.CLIPPY.SUSPICIOUS_XOR_USED_AS_POW
|
Rust Clippy Lints |
XOR (`^`) operator possibly used as exponentiation operator |
3 |
False |
| RS.CLIPPY.SWAP_PTR_TO_REF
|
Rust Clippy Lints |
call to `mem::swap` using pointer derived references |
3 |
False |
| RS.CLIPPY.SWAP_WITH_TEMPORARY
|
Rust Clippy Lints |
detect swap with a temporary value |
3 |
False |
| RS.CLIPPY.TABS_IN_DOC_COMMENTS
|
Rust Clippy Lints |
using tabs in doc comments is not recommended |
3 |
False |
| RS.CLIPPY.TEMPORARY_ASSIGNMENT
|
Rust Clippy Lints |
assignments to temporaries |
3 |
False |
| RS.CLIPPY.TESTS_OUTSIDE_TEST_MODULE
|
Rust Clippy Lints |
A test function is outside the testing module. |
3 |
False |
| RS.CLIPPY.TEST_ATTR_IN_DOCTEST
|
Rust Clippy Lints |
presence of `#[test]` in code examples |
3 |
False |
| RS.CLIPPY.TODO
|
Rust Clippy Lints |
`todo!` should not be present in production code |
3 |
False |
| RS.CLIPPY.TOO_LONG_FIRST_DOC_PARAGRAPH
|
Rust Clippy Lints |
ensure the first documentation paragraph is short |
3 |
False |
| RS.CLIPPY.TOO_MANY_ARGUMENTS
|
Rust Clippy Lints |
functions with too many arguments |
3 |
False |
| RS.CLIPPY.TOO_MANY_LINES
|
Rust Clippy Lints |
functions with too many lines |
3 |
False |
| RS.CLIPPY.TOPLEVEL_REF_ARG
|
Rust Clippy Lints |
an entire binding declared as `ref`, in a function argument or a `let` statement |
3 |
False |
| RS.CLIPPY.TO_DIGIT_IS_SOME
|
Rust Clippy Lints |
`char.is_digit()` is clearer |
3 |
False |
| RS.CLIPPY.TO_STRING_IN_FORMAT_ARGS
|
Rust Clippy Lints |
`to_string` applied to a type that implements `Display` in format args |
3 |
False |
| RS.CLIPPY.TO_STRING_TRAIT_IMPL
|
Rust Clippy Lints |
check for direct implementations of `ToString` |
3 |
False |
| RS.CLIPPY.TRAILING_EMPTY_ARRAY
|
Rust Clippy Lints |
struct with a trailing zero-sized array but without `#[repr(C)]` or another `repr` attribute |
3 |
False |
| RS.CLIPPY.TRAIT_DUPLICATION_IN_BOUNDS
|
Rust Clippy Lints |
check if the same trait bounds are specified more than once during a generic declaration |
3 |
False |
| RS.CLIPPY.TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS
|
Rust Clippy Lints |
transmutes that could be a pointer cast |
3 |
False |
| RS.CLIPPY.TRANSMUTE_BYTES_TO_STR
|
Rust Clippy Lints |
transmutes from a `&[u8]` to a `&str` |
3 |
False |
| RS.CLIPPY.TRANSMUTE_INT_TO_BOOL
|
Rust Clippy Lints |
transmutes from an integer to a `bool` |
3 |
False |
| RS.CLIPPY.TRANSMUTE_INT_TO_NON_ZERO
|
Rust Clippy Lints |
transmutes from an integer to a non-zero wrapper |
3 |
False |
| RS.CLIPPY.TRANSMUTE_NULL_TO_FN
|
Rust Clippy Lints |
transmute results in a null function pointer, which is undefined behavior |
3 |
False |
| RS.CLIPPY.TRANSMUTE_PTR_TO_PTR
|
Rust Clippy Lints |
transmutes from a pointer to a pointer / a reference to a reference |
3 |
False |
| RS.CLIPPY.TRANSMUTE_PTR_TO_REF
|
Rust Clippy Lints |
transmutes from a pointer to a reference type |
3 |
False |
| RS.CLIPPY.TRANSMUTE_UNDEFINED_REPR
|
Rust Clippy Lints |
transmute to or from a type with an undefined representation |
3 |
False |
| RS.CLIPPY.TRANSMUTING_NULL
|
Rust Clippy Lints |
transmutes from a null pointer to a reference, which is undefined behavior |
3 |
False |
| RS.CLIPPY.TRIM_SPLIT_WHITESPACE
|
Rust Clippy Lints |
using `str::trim()` or alike before `str::split_whitespace` |
3 |
False |
| RS.CLIPPY.TRIVIALLY_COPY_PASS_BY_REF
|
Rust Clippy Lints |
functions taking small copyable arguments by reference |
3 |
False |
| RS.CLIPPY.TRIVIAL_REGEX
|
Rust Clippy Lints |
trivial regular expressions |
3 |
False |
| RS.CLIPPY.TRY_ERR
|
Rust Clippy Lints |
return errors explicitly rather than hiding them behind a `?` |
3 |
False |
| RS.CLIPPY.TUPLE_ARRAY_CONVERSIONS
|
Rust Clippy Lints |
checks for tuple<=>array conversions that are not done with `.into()` |
3 |
False |
| RS.CLIPPY.TYPE_COMPLEXITY
|
Rust Clippy Lints |
usage of very complex types that might be better factored into `type` definitions |
3 |
False |
| RS.CLIPPY.TYPE_ID_ON_BOX
|
Rust Clippy Lints |
calling `.type_id()` on a boxed trait object |
3 |
False |
| RS.CLIPPY.TYPE_REPETITION_IN_BOUNDS
|
Rust Clippy Lints |
types are repeated unnecessarily in trait bounds, use `+` instead of using `T: _, T: _` |
3 |
False |
| RS.CLIPPY.UNBUFFERED_BYTES
|
Rust Clippy Lints |
calling .bytes() is very inefficient when data is not in memory |
3 |
False |
| RS.CLIPPY.UNCHECKED_DURATION_SUBTRACTION
|
Rust Clippy Lints |
finds unchecked subtraction of a 'Duration' from an 'Instant' |
3 |
False |
| RS.CLIPPY.UNCONDITIONAL_RECURSION
|
Rust Clippy Lints |
detect unconditional recursion in some traits implementation |
3 |
False |
| RS.CLIPPY.UNDOCUMENTED_UNSAFE_BLOCKS
|
Rust Clippy Lints |
creating an unsafe block without explaining why it is safe |
3 |
False |
| RS.CLIPPY.UNICODE_NOT_NFC
|
Rust Clippy Lints |
using a Unicode literal not in NFC normal form (see [Unicode tr15](http://www.unicode.org/reports/tr15/) for further information) |
3 |
False |
| RS.CLIPPY.UNIMPLEMENTED
|
Rust Clippy Lints |
`unimplemented!` should not be present in production code |
3 |
False |
| RS.CLIPPY.UNINHABITED_REFERENCES
|
Rust Clippy Lints |
reference to uninhabited type |
3 |
False |
| RS.CLIPPY.UNINIT_ASSUMED_INIT
|
Rust Clippy Lints |
`MaybeUninit::uninit().assume_init()` |
3 |
False |
| RS.CLIPPY.UNINIT_VEC
|
Rust Clippy Lints |
Vec with uninitialized data |
3 |
False |
| RS.CLIPPY.UNINLINED_FORMAT_ARGS
|
Rust Clippy Lints |
using non-inlined variables in `format!` calls |
3 |
False |
| RS.CLIPPY.UNIT_ARG
|
Rust Clippy Lints |
passing unit to a function |
3 |
False |
| RS.CLIPPY.UNIT_CMP
|
Rust Clippy Lints |
comparing unit values |
3 |
False |
| RS.CLIPPY.UNIT_HASH
|
Rust Clippy Lints |
hashing a unit value, which does nothing |
3 |
False |
| RS.CLIPPY.UNIT_RETURN_EXPECTING_ORD
|
Rust Clippy Lints |
fn arguments of type Fn(...) -> Ord returning the unit type (). |
3 |
False |
| RS.CLIPPY.UNNECESSARY_BOX_RETURNS
|
Rust Clippy Lints |
Needlessly returning a Box |
3 |
False |
| RS.CLIPPY.UNNECESSARY_CAST
|
Rust Clippy Lints |
cast to the same type, e.g., `x as i32` where `x: i32` |
3 |
False |
| RS.CLIPPY.UNNECESSARY_CLIPPY_CFG
|
Rust Clippy Lints |
usage of `cfg_attr(clippy, allow(clippy::lint))` instead of `allow(clippy::lint)` |
3 |
False |
| RS.CLIPPY.UNNECESSARY_DEBUG_FORMATTING
|
Rust Clippy Lints |
`Debug` formatting applied to an `OsStr` or `Path` when `.display()` is available |
3 |
False |
| RS.CLIPPY.UNNECESSARY_FALLIBLE_CONVERSIONS
|
Rust Clippy Lints |
calling the `try_from` and `try_into` trait methods when `From`/`Into` is implemented |
3 |
False |
| RS.CLIPPY.UNNECESSARY_FILTER_MAP
|
Rust Clippy Lints |
using `filter_map` when a more succinct alternative exists |
3 |
False |
| RS.CLIPPY.UNNECESSARY_FIND_MAP
|
Rust Clippy Lints |
using `find_map` when a more succinct alternative exists |
3 |
False |
| RS.CLIPPY.UNNECESSARY_FIRST_THEN_CHECK
|
Rust Clippy Lints |
calling `.first().is_some()` or `.first().is_none()` instead of `.is_empty()` |
3 |
False |
| RS.CLIPPY.UNNECESSARY_FOLD
|
Rust Clippy Lints |
using `fold` when a more succinct alternative exists |
3 |
False |
| RS.CLIPPY.UNNECESSARY_GET_THEN_CHECK
|
Rust Clippy Lints |
calling `.get().is_some()` or `.get().is_none()` instead of `.contains()` or `.contains_key()` |
3 |
False |
| RS.CLIPPY.UNNECESSARY_JOIN
|
Rust Clippy Lints |
using `.collect::<Vec<String>>().join(\"\")` on an iterator |
3 |
False |
| RS.CLIPPY.UNNECESSARY_LAZY_EVALUATIONS
|
Rust Clippy Lints |
using unnecessary lazy evaluation, which can be replaced with simpler eager evaluation |
3 |
False |
| RS.CLIPPY.UNNECESSARY_LITERAL_BOUND
|
Rust Clippy Lints |
detects &str that could be &'static str in function return types |
3 |
False |
| RS.CLIPPY.UNNECESSARY_LITERAL_UNWRAP
|
Rust Clippy Lints |
using `unwrap()` related calls on `Result` and `Option` constructors |
3 |
False |
| RS.CLIPPY.UNNECESSARY_MAP_ON_CONSTRUCTOR
|
Rust Clippy Lints |
using `map`/`map_err` on `Option` or `Result` constructors |
3 |
False |
| RS.CLIPPY.UNNECESSARY_MAP_OR
|
Rust Clippy Lints |
reduce unnecessary calls to `.map_or(bool, …)` |
3 |
False |
| RS.CLIPPY.UNNECESSARY_MIN_OR_MAX
|
Rust Clippy Lints |
using 'min()/max()' when there is no need for it |
3 |
False |
| RS.CLIPPY.UNNECESSARY_MUT_PASSED
|
Rust Clippy Lints |
an argument passed as a mutable reference although the callee only demands an immutable reference |
3 |
False |
| RS.CLIPPY.UNNECESSARY_OPERATION
|
Rust Clippy Lints |
outer expressions with no effect |
3 |
False |
| RS.CLIPPY.UNNECESSARY_OWNED_EMPTY_STRINGS
|
Rust Clippy Lints |
detects cases of references to owned empty strings being passed as an argument to a function expecting `&str` |
3 |
False |
| RS.CLIPPY.UNNECESSARY_RESULT_MAP_OR_ELSE
|
Rust Clippy Lints |
making no use of the \"map closure\" when calling `.map_or_else(|err| handle_error(err), |n| n)` |
3 |
False |
| RS.CLIPPY.UNNECESSARY_SAFETY_COMMENT
|
Rust Clippy Lints |
annotating safe code with a safety comment |
3 |
False |
| RS.CLIPPY.UNNECESSARY_SAFETY_DOC
|
Rust Clippy Lints |
`pub fn` or `pub trait` with `# Safety` docs |
3 |
False |
| RS.CLIPPY.UNNECESSARY_SELF_IMPORTS
|
Rust Clippy Lints |
imports ending in `::{self}`, which can be omitted |
3 |
False |
| RS.CLIPPY.UNNECESSARY_SEMICOLON
|
Rust Clippy Lints |
unnecessary semicolon after expression returning `()` |
3 |
False |
| RS.CLIPPY.UNNECESSARY_SORT_BY
|
Rust Clippy Lints |
Use of `Vec::sort_by` when `Vec::sort_by_key` or `Vec::sort` would be clearer |
3 |
False |
| RS.CLIPPY.UNNECESSARY_STRUCT_INITIALIZATION
|
Rust Clippy Lints |
struct built from a base that can be written mode concisely |
3 |
False |
| RS.CLIPPY.UNNECESSARY_TO_OWNED
|
Rust Clippy Lints |
unnecessary calls to `to_owned`-like functions |
3 |
False |
| RS.CLIPPY.UNNECESSARY_UNWRAP
|
Rust Clippy Lints |
checks for calls of `unwrap[_err]()` that cannot fail |
3 |
False |
| RS.CLIPPY.UNNECESSARY_WRAPS
|
Rust Clippy Lints |
functions that only return `Ok` or `Some` |
3 |
False |
| RS.CLIPPY.UNNEEDED_FIELD_PATTERN
|
Rust Clippy Lints |
struct fields bound to a wildcard instead of using `..` |
3 |
False |
| RS.CLIPPY.UNNEEDED_STRUCT_PATTERN
|
Rust Clippy Lints |
using struct pattern to match against unit variant |
3 |
False |
| RS.CLIPPY.UNNEEDED_WILDCARD_PATTERN
|
Rust Clippy Lints |
tuple patterns with a wildcard pattern (`_`) is next to a rest pattern (`..`) |
3 |
False |
| RS.CLIPPY.UNNESTED_OR_PATTERNS
|
Rust Clippy Lints |
unnested or-patterns, e.g., `Foo(Bar) | Foo(Baz) instead of `Foo(Bar | Baz)` |
3 |
False |
| RS.CLIPPY.UNREACHABLE
|
Rust Clippy Lints |
usage of the `unreachable!` macro |
3 |
False |
| RS.CLIPPY.UNREADABLE_LITERAL
|
Rust Clippy Lints |
long literal without underscores |
3 |
False |
| RS.CLIPPY.UNSAFE_DERIVE_DESERIALIZE
|
Rust Clippy Lints |
deriving `serde::Deserialize` on a type that has methods using `unsafe` |
3 |
False |
| RS.CLIPPY.UNSAFE_REMOVED_FROM_NAME
|
Rust Clippy Lints |
`unsafe` removed from API names on import |
3 |
False |
| RS.CLIPPY.UNSEPARATED_LITERAL_SUFFIX
|
Rust Clippy Lints |
literals whose suffix is not separated by an underscore |
3 |
False |
| RS.CLIPPY.UNSOUND_COLLECTION_TRANSMUTE
|
Rust Clippy Lints |
transmute between collections of layout-incompatible types |
3 |
False |
| RS.CLIPPY.UNUSED_ASYNC
|
Rust Clippy Lints |
finds async functions with no await statements |
3 |
False |
| RS.CLIPPY.UNUSED_ENUMERATE_INDEX
|
Rust Clippy Lints |
using `.enumerate()` and immediately dropping the index |
3 |
False |
| RS.CLIPPY.UNUSED_FORMAT_SPECS
|
Rust Clippy Lints |
use of a format specifier that has no effect |
3 |
False |
| RS.CLIPPY.UNUSED_IO_AMOUNT
|
Rust Clippy Lints |
unused written/read amount |
3 |
False |
| RS.CLIPPY.UNUSED_PEEKABLE
|
Rust Clippy Lints |
creating a peekable iterator without using any of its methods |
3 |
False |
| RS.CLIPPY.UNUSED_RESULT_OK
|
Rust Clippy Lints |
Use of `.ok()` to silence `Result`'s `#[must_use]` is misleading. Use `let _ =` instead. |
3 |
False |
| RS.CLIPPY.UNUSED_ROUNDING
|
Rust Clippy Lints |
Uselessly rounding a whole number floating-point literal |
3 |
False |
| RS.CLIPPY.UNUSED_SELF
|
Rust Clippy Lints |
methods that contain a `self` argument but don't use it |
3 |
False |
| RS.CLIPPY.UNUSED_TRAIT_NAMES
|
Rust Clippy Lints |
use items that import a trait but only use it anonymously |
3 |
False |
| RS.CLIPPY.UNUSED_UNIT
|
Rust Clippy Lints |
needless unit expression |
3 |
False |
| RS.CLIPPY.UNUSUAL_BYTE_GROUPINGS
|
Rust Clippy Lints |
binary or hex literals that aren't grouped by four |
3 |
False |
| RS.CLIPPY.UNWRAP_IN_RESULT
|
Rust Clippy Lints |
functions of type `Result<..>` or `Option`<...> that contain `expect()` or `unwrap()` |
3 |
False |
| RS.CLIPPY.UNWRAP_OR_DEFAULT
|
Rust Clippy Lints |
using `.unwrap_or`, etc. with an argument that constructs a default value |
3 |
False |
| RS.CLIPPY.UNWRAP_USED
|
Rust Clippy Lints |
using `.unwrap()` on `Result` or `Option`, which should at least get a better message using `expect()` |
3 |
False |
| RS.CLIPPY.UPPER_CASE_ACRONYMS
|
Rust Clippy Lints |
capitalized acronyms are against the naming convention |
3 |
False |
| RS.CLIPPY.USED_UNDERSCORE_BINDING
|
Rust Clippy Lints |
using a binding which is prefixed with an underscore |
3 |
False |
| RS.CLIPPY.USED_UNDERSCORE_ITEMS
|
Rust Clippy Lints |
using a item which is prefixed with an underscore |
3 |
False |
| RS.CLIPPY.USELESS_ASREF
|
Rust Clippy Lints |
using `as_ref` where the types before and after the call are the same |
3 |
False |
| RS.CLIPPY.USELESS_ATTRIBUTE
|
Rust Clippy Lints |
use of lint attributes on `extern crate` items |
3 |
False |
| RS.CLIPPY.USELESS_CONCAT
|
Rust Clippy Lints |
checks that the `concat` macro has at least two arguments |
3 |
False |
| RS.CLIPPY.USELESS_CONVERSION
|
Rust Clippy Lints |
calls to `Into`, `TryInto`, `From`, `TryFrom`, or `IntoIter` which perform useless conversions to the same type |
3 |
False |
| RS.CLIPPY.USELESS_FORMAT
|
Rust Clippy Lints |
useless use of `format!` |
3 |
False |
| RS.CLIPPY.USELESS_LET_IF_SEQ
|
Rust Clippy Lints |
unidiomatic `let mut` declaration followed by initialization in `if` |
3 |
False |
| RS.CLIPPY.USELESS_NONZERO_NEW_UNCHECKED
|
Rust Clippy Lints |
using `NonZero::new_unchecked()` in a `const` context |
3 |
False |
| RS.CLIPPY.USELESS_TRANSMUTE
|
Rust Clippy Lints |
transmutes that have the same to and from types or could be a cast/coercion |
3 |
False |
| RS.CLIPPY.USELESS_VEC
|
Rust Clippy Lints |
useless `vec!` |
3 |
False |
| RS.CLIPPY.USE_DEBUG
|
Rust Clippy Lints |
use of `Debug`-based formatting |
3 |
False |
| RS.CLIPPY.USE_SELF
|
Rust Clippy Lints |
unnecessary structure name repetition whereas `Self` is applicable |
3 |
False |
| RS.CLIPPY.VEC_BOX
|
Rust Clippy Lints |
usage of `Vec<Box<T>>` where T: Sized, vector elements are already on the heap |
3 |
False |
| RS.CLIPPY.VEC_INIT_THEN_PUSH
|
Rust Clippy Lints |
`push` immediately after `Vec` creation |
3 |
False |
| RS.CLIPPY.VEC_RESIZE_TO_ZERO
|
Rust Clippy Lints |
emptying a vector with `resize(0, an_int)` instead of `clear()` is probably an argument inversion mistake |
3 |
False |
| RS.CLIPPY.VERBOSE_BIT_MASK
|
Rust Clippy Lints |
expressions where a bit mask is less readable than the corresponding method call |
3 |
False |
| RS.CLIPPY.VERBOSE_FILE_READS
|
Rust Clippy Lints |
use of `File::read_to_end` or `File::read_to_string` |
3 |
False |
| RS.CLIPPY.WAKER_CLONE_WAKE
|
Rust Clippy Lints |
cloning a `Waker` only to wake it |
3 |
False |
| RS.CLIPPY.WHILE_FLOAT
|
Rust Clippy Lints |
while loops comparing floating point values |
3 |
False |
| RS.CLIPPY.WHILE_IMMUTABLE_CONDITION
|
Rust Clippy Lints |
variables used within while expression are not mutated in the body |
3 |
False |
| RS.CLIPPY.WHILE_LET_LOOP
|
Rust Clippy Lints |
`loop { if let { ... } else break }`, which can be written as a `while let` loop |
3 |
False |
| RS.CLIPPY.WHILE_LET_ON_ITERATOR
|
Rust Clippy Lints |
using a `while let` loop instead of a for loop on an iterator |
3 |
False |
| RS.CLIPPY.WILDCARD_DEPENDENCIES
|
Rust Clippy Lints |
wildcard dependencies being used |
3 |
False |
| RS.CLIPPY.WILDCARD_ENUM_MATCH_ARM
|
Rust Clippy Lints |
a wildcard enum match arm using `_` |
3 |
False |
| RS.CLIPPY.WILDCARD_IMPORTS
|
Rust Clippy Lints |
lint `use _::*` statements |
3 |
False |
| RS.CLIPPY.WILDCARD_IN_OR_PATTERNS
|
Rust Clippy Lints |
a wildcard pattern used with others patterns in same match arm |
3 |
False |
| RS.CLIPPY.WRITELN_EMPTY_STRING
|
Rust Clippy Lints |
using `writeln!(buf, \"\")` with an empty string |
3 |
False |
| RS.CLIPPY.WRITE_LITERAL
|
Rust Clippy Lints |
writing a literal with a format string |
3 |
False |
| RS.CLIPPY.WRITE_WITH_NEWLINE
|
Rust Clippy Lints |
using `write!()` with a format string that ends in a single newline |
3 |
False |
| RS.CLIPPY.WRONG_SELF_CONVENTION
|
Rust Clippy Lints |
defining a method named with an established prefix (like \"into_\") that takes `self` with the wrong convention |
3 |
False |
| RS.CLIPPY.WRONG_TRANSMUTE
|
Rust Clippy Lints |
transmutes that are confusing at best, undefined behavior at worst and always useless |
3 |
False |
| RS.CLIPPY.ZERO_DIVIDED_BY_ZERO
|
Rust Clippy Lints |
usage of `0.0 / 0.0` to obtain NaN instead of `f32::NAN` or `f64::NAN` |
3 |
False |
| RS.CLIPPY.ZERO_PREFIXED_LITERAL
|
Rust Clippy Lints |
integer literals starting with `0` |
3 |
False |
| RS.CLIPPY.ZERO_PTR
|
Rust Clippy Lints |
using `0 as *{const, mut} T` |
3 |
False |
| RS.CLIPPY.ZERO_REPEAT_SIDE_EFFECTS
|
Rust Clippy Lints |
usage of zero-sized initializations of arrays or vecs causing side effects |
3 |
False |
| RS.CLIPPY.ZERO_SIZED_MAP_VALUES
|
Rust Clippy Lints |
usage of map with zero-sized value type |
3 |
False |
| RS.CLIPPY.ZOMBIE_PROCESSES
|
Rust Clippy Lints |
not waiting on a spawned child process |
3 |
False |
| RS.CLIPPY.ZST_OFFSET
|
Rust Clippy Lints |
Check for offset calculations on raw pointers to zero-sized types |
3 |
False |