Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more clippy cleanups #69713

Merged
merged 5 commits into from
Mar 6, 2020
Merged

more clippy cleanups #69713

merged 5 commits into from
Mar 6, 2020

Commits on Mar 4, 2020

  1. Don't use .ok() before unwrapping via .expect() on a Result.

    The Result can be expect-unwrapped directly. (clippy::ok_expect)
    matthiaskrgr committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    07168f9 View commit details
    Browse the repository at this point in the history
  2. Use .map() to modify data inside Options instead of using .and_then(|…

    …x| Some(y)) (clippy::option_and_then_some)
    matthiaskrgr committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    569676b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    38f5db7 View commit details
    Browse the repository at this point in the history
  4. Don't use "if let" bindings to only check a value and not actually bi…

    …nd anything.
    
    For example:  `if let Some(_) = foo() {}`	can be reduced to	`if foo().is_some() {}`   (clippy::redundant_pattern_matching)
    matthiaskrgr committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    d8d2004 View commit details
    Browse the repository at this point in the history
  5. Use single-char patter on {ends,starts}_with and remove clone on copy…

    … type.
    
    These were introduced since I last fixed most of these occurences. (clippy::clone_on_copy, clippy::single_char_pattern)
    matthiaskrgr committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    80ed505 View commit details
    Browse the repository at this point in the history