Skip to content

Commit 48f4f27

Browse files
committed
Resolve clippy::redundant_closure
error: redundant closure --> src/data_race.rs:787:18 | 787 | .map(|idx| VectorIdx::new(idx)) | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `VectorIdx::new` | = note: `-D clippy::redundant-closure` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure error: redundant closure --> src/thread.rs:61:31 | 61 | u32::try_from(id).map(|id_u32| Self(id_u32)) | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
1 parent 9551058 commit 48f4f27

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/data_race.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ impl VClockAlloc {
784784
None
785785
}
786786
})
787-
.map(|idx| VectorIdx::new(idx))
787+
.map(VectorIdx::new)
788788
}
789789

790790
/// Report a data-race found in the program.

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
clippy::manual_map,
2121
clippy::needless_lifetimes,
2222
clippy::new_without_default,
23-
clippy::redundant_closure,
2423
clippy::redundant_field_names,
2524
clippy::single_char_add_str,
2625
clippy::single_char_pattern,

src/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl Idx for ThreadId {
5858
impl TryFrom<u64> for ThreadId {
5959
type Error = TryFromIntError;
6060
fn try_from(id: u64) -> Result<Self, Self::Error> {
61-
u32::try_from(id).map(|id_u32| Self(id_u32))
61+
u32::try_from(id).map(Self)
6262
}
6363
}
6464

0 commit comments

Comments
 (0)