Skip to content

Commit 2bafb54

Browse files
committed
Implement Debug and Clone for variant DictEntry
1 parent fec12a0 commit 2bafb54

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

glib/src/variant.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,32 @@ where
16241624
}
16251625
}
16261626

1627+
impl<K, V> fmt::Debug for DictEntry<K, V>
1628+
where
1629+
K: fmt::Debug,
1630+
V: fmt::Debug,
1631+
{
1632+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1633+
f.debug_struct("DictEntry")
1634+
.field("key", &self.key)
1635+
.field("value", &self.value)
1636+
.finish()
1637+
}
1638+
}
1639+
1640+
impl<K, V> Clone for DictEntry<K, V>
1641+
where
1642+
K: Clone,
1643+
V: Clone,
1644+
{
1645+
fn clone(&self) -> Self {
1646+
Self {
1647+
key: self.key.clone(),
1648+
value: self.value.clone(),
1649+
}
1650+
}
1651+
}
1652+
16271653
impl<K, V> FromVariant for DictEntry<K, V>
16281654
where
16291655
K: FromVariant,

0 commit comments

Comments
 (0)