Skip to content

Commit a1495fd

Browse files
authored
Merge pull request #301 from cuviper/unstringify
Remove unnecessary `stringify!`
2 parents aed1204 + 77382d6 commit a1495fd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/map/core/entry.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,12 @@ impl<'a, K, V> Entry<'a, K, V> {
113113

114114
impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for Entry<'_, K, V> {
115115
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
116-
match *self {
117-
Entry::Vacant(ref v) => f.debug_tuple(stringify!(Entry)).field(v).finish(),
118-
Entry::Occupied(ref o) => f.debug_tuple(stringify!(Entry)).field(o).finish(),
119-
}
116+
let mut tuple = f.debug_tuple("Entry");
117+
match self {
118+
Entry::Vacant(v) => tuple.field(v),
119+
Entry::Occupied(o) => tuple.field(o),
120+
};
121+
tuple.finish()
120122
}
121123
}
122124

@@ -239,7 +241,7 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> {
239241

240242
impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for OccupiedEntry<'_, K, V> {
241243
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
242-
f.debug_struct(stringify!(OccupiedEntry))
244+
f.debug_struct("OccupiedEntry")
243245
.field("key", self.key())
244246
.field("value", self.get())
245247
.finish()
@@ -284,9 +286,7 @@ impl<'a, K, V> VacantEntry<'a, K, V> {
284286

285287
impl<K: fmt::Debug, V> fmt::Debug for VacantEntry<'_, K, V> {
286288
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
287-
f.debug_tuple(stringify!(VacantEntry))
288-
.field(self.key())
289-
.finish()
289+
f.debug_tuple("VacantEntry").field(self.key()).finish()
290290
}
291291
}
292292

@@ -387,7 +387,7 @@ impl<'a, K, V> IndexedEntry<'a, K, V> {
387387

388388
impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for IndexedEntry<'_, K, V> {
389389
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
390-
f.debug_struct(stringify!(IndexedEntry))
390+
f.debug_struct("IndexedEntry")
391391
.field("index", &self.index)
392392
.field("key", self.key())
393393
.field("value", self.get())

0 commit comments

Comments
 (0)