From 313085f7258ef86cf190aa6c234a42843995fdbc Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 8 Apr 2024 17:48:07 -0400 Subject: Change method calls to using the method directly This is in accordance with Clippy's redundant_closure_for_method_calls. --- library/std/src/thread/local.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'library/std/src') 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 LocalKey> { 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 LocalKey> { 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 LocalKey> { where T: Default, { - self.with(|cell| cell.take()) + self.with(RefCell::take) } /// Replaces the contained value, returning the old value. -- cgit 1.4.1-3-g733a5