about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-04-08 17:48:07 -0400
committerTrevor Gross <tmgross@umich.edu>2024-04-08 17:48:07 -0400
commit313085f7258ef86cf190aa6c234a42843995fdbc (patch)
tree69a7e67795c3b3a2c9d37585ba80b451c3298723
parent6e68a2f475593f15c9bb3fdbe9b53633a5aa0659 (diff)
downloadrust-313085f7258ef86cf190aa6c234a42843995fdbc.tar.gz
rust-313085f7258ef86cf190aa6c234a42843995fdbc.zip
Change method calls to using the method directly
This is in accordance with Clippy's redundant_closure_for_method_calls.
-rw-r--r--library/std/src/thread/local.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs
index a4acd6c3d06..c1b4440e560 100644
--- a/library/std/src/thread/local.rs
+++ b/library/std/src/thread/local.rs
@@ -381,7 +381,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
     where
         T: Copy,
     {
-        self.with(|cell| cell.get())
+        self.with(Cell::get)
     }
 
     /// Takes the contained value, leaving `Default::default()` in its place.
@@ -411,7 +411,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
     where
         T: Default,
     {
-        self.with(|cell| cell.take())
+        self.with(Cell::take)
     }
 
     /// Replaces the contained value, returning the old value.
@@ -582,7 +582,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
     where
         T: Default,
     {
-        self.with(|cell| cell.take())
+        self.with(RefCell::take)
     }
 
     /// Replaces the contained value, returning the old value.