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.