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 #261

Merged
merged 7 commits into from
Dec 22, 2020
Merged

More clippy #261

merged 7 commits into from
Dec 22, 2020

Commits on Dec 22, 2020

  1. Implement is_empty method

    Clippy warns of missing `is_empty`, trivially implement it by calling
    through to `self.data.is_empty()`.
    tcharding committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    4e87e6f View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary return statements

    Found by clippy. We don't need a `return` for the final statement.
    tcharding committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    ed29f12 View commit details
    Browse the repository at this point in the history
  3. Remove unused error return value

    This helper never returns an error, remove the `Result` return type.
    Found by clippy.
    tcharding committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    34ad411 View commit details
    Browse the repository at this point in the history
  4. Return Ok directly

    Clippy emits warning:
    
    	warning: passing a unit value to a function
    
    Just return `Ok(())` after calling `fill_bytes`.
    tcharding committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    ef23cb8 View commit details
    Browse the repository at this point in the history
  5. Remove unnecessary clone

    Type is `Copy`, no need for clone.
    tcharding committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    c92b946 View commit details
    Browse the repository at this point in the history
  6. Use for loop instead of map

    Currently we are misusing `map` on an iterator to loop `n` times,
    additionally the assertion is pointless. Use a for loop and assert
    against the length of the set.
    tcharding committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    c38136b View commit details
    Browse the repository at this point in the history
  7. Use ManuallyDrop

    Suggested by clippy, we need to use ManuallyDrop for these types in
    order to correctly free up the memory.
    tcharding committed Dec 22, 2020
    Configuration menu
    Copy the full SHA
    a584643 View commit details
    Browse the repository at this point in the history