@@ -1407,6 +1407,14 @@ impl<K, V> Clone for Iter<'_, K, V> {
1407
1407
}
1408
1408
}
1409
1409
1410
+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1411
+ impl < K , V > Default for Iter < ' _ , K , V > {
1412
+ #[ inline]
1413
+ fn default ( ) -> Self {
1414
+ Iter { base : Default :: default ( ) }
1415
+ }
1416
+ }
1417
+
1410
1418
#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
1411
1419
impl < K : Debug , V : Debug > fmt:: Debug for Iter < ' _ , K , V > {
1412
1420
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1445,6 +1453,14 @@ impl<'a, K, V> IterMut<'a, K, V> {
1445
1453
}
1446
1454
}
1447
1455
1456
+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1457
+ impl < K , V > Default for IterMut < ' _ , K , V > {
1458
+ #[ inline]
1459
+ fn default ( ) -> Self {
1460
+ IterMut { base : Default :: default ( ) }
1461
+ }
1462
+ }
1463
+
1448
1464
/// An owning iterator over the entries of a `HashMap`.
1449
1465
///
1450
1466
/// This `struct` is created by the [`into_iter`] method on [`HashMap`]
@@ -1475,6 +1491,14 @@ impl<K, V> IntoIter<K, V> {
1475
1491
}
1476
1492
}
1477
1493
1494
+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1495
+ impl < K , V > Default for IntoIter < K , V > {
1496
+ #[ inline]
1497
+ fn default ( ) -> Self {
1498
+ IntoIter { base : Default :: default ( ) }
1499
+ }
1500
+ }
1501
+
1478
1502
/// An iterator over the keys of a `HashMap`.
1479
1503
///
1480
1504
/// This `struct` is created by the [`keys`] method on [`HashMap`]. See its
@@ -1507,6 +1531,14 @@ impl<K, V> Clone for Keys<'_, K, V> {
1507
1531
}
1508
1532
}
1509
1533
1534
+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1535
+ impl < K , V > Default for Keys < ' _ , K , V > {
1536
+ #[ inline]
1537
+ fn default ( ) -> Self {
1538
+ Keys { inner : Default :: default ( ) }
1539
+ }
1540
+ }
1541
+
1510
1542
#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
1511
1543
impl < K : Debug , V > fmt:: Debug for Keys < ' _ , K , V > {
1512
1544
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1546,6 +1578,14 @@ impl<K, V> Clone for Values<'_, K, V> {
1546
1578
}
1547
1579
}
1548
1580
1581
+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1582
+ impl < K , V > Default for Values < ' _ , K , V > {
1583
+ #[ inline]
1584
+ fn default ( ) -> Self {
1585
+ Values { inner : Default :: default ( ) }
1586
+ }
1587
+ }
1588
+
1549
1589
#[ stable( feature = "std_debug" , since = "1.16.0" ) ]
1550
1590
impl < K , V : Debug > fmt:: Debug for Values < ' _ , K , V > {
1551
1591
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
@@ -1634,6 +1674,14 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
1634
1674
inner : IterMut < ' a , K , V > ,
1635
1675
}
1636
1676
1677
+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1678
+ impl < K , V > Default for ValuesMut < ' _ , K , V > {
1679
+ #[ inline]
1680
+ fn default ( ) -> Self {
1681
+ ValuesMut { inner : Default :: default ( ) }
1682
+ }
1683
+ }
1684
+
1637
1685
/// An owning iterator over the keys of a `HashMap`.
1638
1686
///
1639
1687
/// This `struct` is created by the [`into_keys`] method on [`HashMap`].
@@ -1656,6 +1704,14 @@ pub struct IntoKeys<K, V> {
1656
1704
inner : IntoIter < K , V > ,
1657
1705
}
1658
1706
1707
+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1708
+ impl < K , V > Default for IntoKeys < K , V > {
1709
+ #[ inline]
1710
+ fn default ( ) -> Self {
1711
+ IntoKeys { inner : Default :: default ( ) }
1712
+ }
1713
+ }
1714
+
1659
1715
/// An owning iterator over the values of a `HashMap`.
1660
1716
///
1661
1717
/// This `struct` is created by the [`into_values`] method on [`HashMap`].
@@ -1678,6 +1734,14 @@ pub struct IntoValues<K, V> {
1678
1734
inner : IntoIter < K , V > ,
1679
1735
}
1680
1736
1737
+ #[ stable( feature = "default_iters_hash" , since = "CURRENT_RUSTC_VERSION" ) ]
1738
+ impl < K , V > Default for IntoValues < K , V > {
1739
+ #[ inline]
1740
+ fn default ( ) -> Self {
1741
+ IntoValues { inner : Default :: default ( ) }
1742
+ }
1743
+ }
1744
+
1681
1745
/// A builder for computing where in a HashMap a key-value pair would be stored.
1682
1746
///
1683
1747
/// See the [`HashMap::raw_entry_mut`] docs for usage examples.
0 commit comments