First Pull Request


collapsible_if shouldn't apply if there is a comment before rust-lang/rust-clippy

In this example there is comment which applies to both branches in the `else` block. ``` if entry.end > entry.base { prev = entry_; // Go to the next entry } else { ...

Created - 0 comments - E-easy L-enhancement

improve collapsible if in complex cases with same expressions rust-lang/rust-clippy

``` rust if a { if b { f(); } } else { f(); } ``` could be ``` rust if !a || b { f(); } ```

Created - 0 comments - E-easy L-enhancement L-lint

float_cmp: ignore when comparing with constant? rust-lang/rust-clippy

Consider: ``` const ONE: f32 = 1.0; fn main() { let v = 0.9; let _ = v == ONE; } ``` These are probably cases where you want to check for the exact constant, because it is a common argume...

Created - 0 comments - E-easy L-enhancement

FR: redundant_field_names should distinguish between all and some fields matching rust-lang/rust-clippy

`redundant_field_names` fires on any field being a match. This impairs readability in cases like this: ```rust let thingy = Thingy { calc: big + calculation, redundant: redundant, o...

Created - 0 comments - A-style L-enhancement good first issue

Support for upcoming `param_attrs` feature rust-lang/rust-clippy

[`param_attrs` is likely to be stabilized in Rust 1.39](https://github.com/rust-lang/rust/pull/64010) The `param_attrs` feature is going to allow lint attributes on function, method and closure...

Created - 0 comments - C-needs-discussion L-enhancement good first issue needs test

should_implement_trait should include ToOwned, FromStr rust-lang/rust-clippy

Also see: servo/rust-url#286. For `FromStr`, clippy should recommend that `parse` methods be renamed to `from_str`.

Created - 1 comment - A-style E-easy L-enhancement T-middle

Make VEC_BOX lint configurable over the size of T rust-lang/rust-clippy

In #3545 the `VEC_BOX` lint was implemented. This lints on usage of `Vec<Box<T: Sized>>` . The `Box` around `T` could make sense though, if `T` is a very large type. (See also https://github.com/ru...

Created - 1 comment - L-enhancement good first issue

type_repetition_in_bounds not always helps rust-lang/rust-clippy

For a trait like this ```rust trait LotsOfBounds where Self: Clone + Copy + Default + Ord, Self: Add<Output = Self> + AddAssign + Sub<Output = Self> + SubAssign, Self: Mul<Output ...

Created - 1 comment - L-enhancement good first issue

precedence should not warn for unary minus before odd function rust-lang/rust-clippy

The `clippy:precedence` list currently warns on every instance of the form `-literal.method()`, as precedence looks ambiguous. However, for an *odd function*, i.e. a function `f(x)` where `f(-x)=-f...

Created - 1 comment - L-enhancement good first issue

Improper error about else if collapse. rust-lang/rust-clippy

Hi, I've got the following code: ```rust if t1 > t2 { if value >= t1 { ValueCheck::Correct } else if value >= t2 { ValueCheck::Warning } else...

Created - 1 comment - L-enhancement good first issue

Possible suggestion improvements on match_ref_pats rust-lang/rust-clippy

Another example from [Carboxyl](https://github.com/aepsil0n/carboxyl/blob/master/src/transaction.rs#L118): ``` match &mut *current.borrow_mut() { &mut Some(ref mut trans) => ac...

Created - 2 comments - E-easy L-enhancement T-AST

doc_markdown should ignore things which just contain acronyms rust-lang/rust-clippy

Instead of needing to manually whitelist, we should ignore things like `DirectX` and `OpenGL`. For something to be camel case, it should have at least two camelcase words in it, each which have at ...

Created - 2 comments - E-easy L-enhancement

doc_markdown should ignore things which just contain acronyms rust-lang/rust-clippy

Instead of needing to manually whitelist, we should ignore things like `DirectX` and `OpenGL`. For something to be camel case, it should have at least two camelcase words in it, each which have at ...

Created - 2 comments - E-easy L-enhancement

"Unneeded return statement" in macro rust-lang/rust-clippy

When using the following macro: ``` macro_rules! derr( ($($arg:tt)*) => (return Err(Decode(format!($($arg)*)))) ); ``` The warning "unneeded return statement" is triggered for every usage of ...

Created - 2 comments - E-easy L-enhancement

improve suggestions around `&*` and don't add parenthesis rust-lang/rust-clippy

~~Is there ever a reason to have an unsized type and ref it instead of having a reference to an unsized type? I think we should simply suggest to use `let p: &str = &*"hello";` instead (and make...

Created - 2 comments - A-style E-easy L-enhancement

Pin<&mut self> triggers "wrong_self_convention" rust-lang/rust-clippy

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. For ...

Created - 2 comments - L-enhancement good first issue

Type complexity should not be considered when defining an associated type rust-lang/rust-clippy

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. If you ...

Created - 3 comments - E-easy L-enhancement

calls to `std::mem::drop` with a `Copy` type rust-lang/rust-clippy

If `x` is `Copy`, `std::mem::drop(x)` has no effect on this variable. This statement is redundant. This can be an extension of `drop_ref` rule.

Created - 3 comments - A-unnecessary E-easy L-enhancement T-middle

Extract commonly used visitors to utils rust-lang/rust-clippy

Both #3427 and #4386 implement a `Visitor` that walks an expression and searches for a `return`. This should be de-duplicated. Maybe there are other `Visitor`s in the Clippy code base, that also...

Created - 3 comments - L-enhancement good first issue

needless_doctest_main vs. question mark operator rust-lang/rust-clippy

I am currently using main with return type `Result<(), Box<Error>>` in order to be able to use the question mark operator in examples. This is recommended in the API guidelines: https://rust-lan...

Created - 3 comments - L-enhancement good first issue

float_cmp: ignore when comparing with constant? rust-lang/rust-clippy

Consider: ``` const ONE: f32 = 1.0; fn main() { let v = 0.9; let _ = v == ONE; } ``` These are probably cases where you want to check for the exact constant, because it is a common argume...

Created - 4 comments - good first issue hacktoberfest L-enhancement

Add utils helper for filtering out type/lifetime parameters on generics rust-lang/rust-clippy

See https://github.com/rust-lang/rust-clippy/pull/3786/files , we have a lot of code that does something like `params.args.iter().filter_map(|arg| match arg { GenericArg::Lifetime(lt) => Some(lt),...

Created - 4 comments - L-enhancement good first issue

unreadable_literal for floating-point numbers rust-lang/rust-clippy

unreadable_literal triggers for floating-point numbers such as > ``` > | > 5 | 0.095332, 0.118095, 0.095332, > | ^^^^^^^^ help: consider: `0.095_332` > ``` ...

Created - 4 comments - A-style L-enhancement L-lint good first issue

Detect broken crate attributes rust-lang/rust-clippy

I want to avoid this embarrassing commit next time: https://github.com/nox/hyper_serde/commit/b1f2eac001d286e9209706fc2e48480543b57fe4

Created - 5 comments - A-correctness L-enhancement good first issue hacktoberfest

len_zero: also handle .len() >= 1 rust-lang/rust-clippy

Since ````.len()```` should return unsigned values in most cases, I think we can treat ````.len() >= 1```` the same as ````.len() != 0```` or am I missing something? ````rust if String::from("h...

Created - 5 comments - L-enhancement T-middle good first issue

match_wild_err_arm: Err(_) is not wild rust-lang/rust-clippy

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place. For ...

Created - 5 comments - L-documentation L-enhancement good first issue

Unrecognized escape sequence rust-lang/rust-clippy

Clippy version: `clippy 0.0.212 (265318d 2019-05-17)` I get the following error when linting code, and I have a feeling it might be a bug. If it is not, it maybe clippy can give a correct sugges...

Created - 5 comments - A-suggestion L-enhancement good first issue

Suggestion for removing `to_string()` to `format!()` rust-lang/rust-clippy

Considering this code: ```rust let s = format!("Hello, {}", "world").to_string(); ``` This `to_string()` isn't needed because `format!` returns `String` type. It'd be nice for Clippy to te...

Created - 5 comments - E-medium L-enhancement L-lint good first issue

large_enum_variant triggered in error-chain macro has unhelpful help message rust-lang/rust-clippy

You know how I like to suggest E-hard new lints? Sorry, this time I only have an E-hard L-enhancement to report. ``` warning: large size difference between variants --> src/main.rs:66:1 ...

Created - 6 comments - E-easy E-medium L-enhancement T-middle

Float comparison lint doesn't seem to trigger on float array comparison rust-lang/rust-clippy

```rust #[test] fn m128_max() { let a: m128 = cast([5.0_f32, 6.0, 7.0, 8.5]); let b: m128 = cast([-8.0_f32, 4.0, 12.0, 0.5]); let out: [f32; 4] = cast(a.max(b)); assert_eq!(out, [5.0_...

Created - 6 comments - L-enhancement good first issue

Displaying issues 1 - 30 of 36 in total

License

Language