Skip to content

Commit 313085f

Browse files
committed
Change method calls to using the method directly
This is in accordance with Clippy's redundant_closure_for_method_calls.
1 parent 6e68a2f commit 313085f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/thread/local.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
381381
where
382382
T: Copy,
383383
{
384-
self.with(|cell| cell.get())
384+
self.with(Cell::get)
385385
}
386386

387387
/// Takes the contained value, leaving `Default::default()` in its place.
@@ -411,7 +411,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
411411
where
412412
T: Default,
413413
{
414-
self.with(|cell| cell.take())
414+
self.with(Cell::take)
415415
}
416416

417417
/// Replaces the contained value, returning the old value.
@@ -582,7 +582,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
582582
where
583583
T: Default,
584584
{
585-
self.with(|cell| cell.take())
585+
self.with(RefCell::take)
586586
}
587587

588588
/// Replaces the contained value, returning the old value.

0 commit comments

Comments
 (0)