From 77382d6522a32f00b6aafc43109a55dd4bc2f0c4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 24 Jan 2024 13:00:35 -0800 Subject: [PATCH] Remove unnecessary `stringify!` --- src/map/core/entry.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/map/core/entry.rs b/src/map/core/entry.rs index 24131bd6..ada26ef7 100644 --- a/src/map/core/entry.rs +++ b/src/map/core/entry.rs @@ -113,10 +113,12 @@ impl<'a, K, V> Entry<'a, K, V> { impl fmt::Debug for Entry<'_, K, V> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match *self { - Entry::Vacant(ref v) => f.debug_tuple(stringify!(Entry)).field(v).finish(), - Entry::Occupied(ref o) => f.debug_tuple(stringify!(Entry)).field(o).finish(), - } + let mut tuple = f.debug_tuple("Entry"); + match self { + Entry::Vacant(v) => tuple.field(v), + Entry::Occupied(o) => tuple.field(o), + }; + tuple.finish() } } @@ -239,7 +241,7 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> { impl fmt::Debug for OccupiedEntry<'_, K, V> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct(stringify!(OccupiedEntry)) + f.debug_struct("OccupiedEntry") .field("key", self.key()) .field("value", self.get()) .finish() @@ -284,9 +286,7 @@ impl<'a, K, V> VacantEntry<'a, K, V> { impl fmt::Debug for VacantEntry<'_, K, V> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_tuple(stringify!(VacantEntry)) - .field(self.key()) - .finish() + f.debug_tuple("VacantEntry").field(self.key()).finish() } } @@ -387,7 +387,7 @@ impl<'a, K, V> IndexedEntry<'a, K, V> { impl fmt::Debug for IndexedEntry<'_, K, V> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct(stringify!(IndexedEntry)) + f.debug_struct("IndexedEntry") .field("index", &self.index) .field("key", self.key()) .field("value", self.get())