We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e68a2f commit 313085fCopy full SHA for 313085f
library/std/src/thread/local.rs
@@ -381,7 +381,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
381
where
382
T: Copy,
383
{
384
- self.with(|cell| cell.get())
+ self.with(Cell::get)
385
}
386
387
/// Takes the contained value, leaving `Default::default()` in its place.
@@ -411,7 +411,7 @@ impl<T: 'static> LocalKey<Cell<T>> {
411
412
T: Default,
413
414
- self.with(|cell| cell.take())
+ self.with(Cell::take)
415
416
417
/// Replaces the contained value, returning the old value.
@@ -582,7 +582,7 @@ impl<T: 'static> LocalKey<RefCell<T>> {
582
583
584
585
+ self.with(RefCell::take)
586
587
588
0 commit comments