Change method calls to using the method directly

This is in accordance with Clippy's redundant_closure_for_method_calls.
This commit is contained in:
Trevor Gross 2024-04-08 17:48:07 -04:00
parent 6e68a2f475
commit 313085f725

View File

@ -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.