Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Resolve semicolon_if_nothing_returned clippy lints
Browse files Browse the repository at this point in the history
    error: consider adding a `;` to the last statement for consistent formatting
      --> src/mapping.rs:40:9
       |
    40 |         self.map.reserve(additional)
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.map.reserve(additional);`
       |
       = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D clippy::pedantic`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
      --> src/mapping.rs:48:9
       |
    48 |         self.map.shrink_to_fit()
       |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.map.shrink_to_fit();`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> src/mapping.rs:104:9
        |
    104 |         self.map.clear()
        |         ^^^^^^^^^^^^^^^^ help: add a `;` here: `self.map.clear();`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
       --> src/number.rs:487:17
        |
    487 |                 3.hash(state)
        |                 ^^^^^^^^^^^^^ help: add a `;` here: `3.hash(state);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned

    error: consider adding a `;` to the last statement for consistent formatting
      --> tests/test_value.rs:48:5
       |
    48 | /     assert_eq!(
    49 | |         test,
    50 | |         Test {
    51 | |             first: "abc".to_string(),
    52 | |             second: 99
    53 | |         }
    54 | |     )
       | |_____^
       |
       = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D clippy::pedantic`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
    help: add a `;` here
       |
    48 |     assert_eq!(
    49 |         test,
    50 |         Test {
    51 |             first: "abc".to_string(),
    52 |             second: 99
    53 |         }
     ...
  • Loading branch information
dtolnay committed Jun 5, 2021
1 parent d00e676 commit cdf6fb9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ impl Mapping {
/// Panics if the new allocation size overflows `usize`.
#[inline]
pub fn reserve(&mut self, additional: usize) {
self.map.reserve(additional)
self.map.reserve(additional);
}

/// Shrinks the capacity of the map as much as possible. It will drop down
/// as much as possible while maintaining the internal rules and possibly
/// leaving some space in accordance with the resize policy.
#[inline]
pub fn shrink_to_fit(&mut self) {
self.map.shrink_to_fit()
self.map.shrink_to_fit();
}

/// Inserts a key-value pair into the map. If the key already existed, the
Expand Down Expand Up @@ -101,7 +101,7 @@ impl Mapping {
/// Clears the map of all key-value pairs.
#[inline]
pub fn clear(&mut self) {
self.map.clear()
self.map.clear();
}

/// Returns a double-ended iterator visiting all key-value pairs in order of
Expand Down
2 changes: 1 addition & 1 deletion src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ impl Hash for Number {
match self.n {
N::Float(_) => {
// you should feel bad for using f64 as a map key
3.hash(state)
3.hash(state);
}
N::PosInt(u) => u.hash(state),
N::NegInt(i) => i.hash(state),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ fn test_into_deserializer() {
first: "abc".to_string(),
second: 99
}
)
);
}

0 comments on commit cdf6fb9

Please sign in to comment.