Skip to content

Commit a3c2f69

Browse files
committed
impl Default for &mut map::Slice, like normal slices
1 parent 4af2713 commit a3c2f69

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/map/slice.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ impl<K, V> Default for &'_ Slice<K, V> {
260260
}
261261
}
262262

263+
impl<K, V> Default for &'_ mut Slice<K, V> {
264+
fn default() -> Self {
265+
Slice::from_mut_slice(&mut [])
266+
}
267+
}
268+
263269
impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for Slice<K, V> {
264270
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
265271
f.debug_list().entries(self).finish()

0 commit comments

Comments
 (0)