@@ -1291,12 +1291,22 @@ impl<'a, T> Iterator for Iter<'a, T> {
1291
1291
fn next ( & mut self ) -> Option < & ' a T > {
1292
1292
self . iter . next ( )
1293
1293
}
1294
+
1294
1295
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
1295
1296
self . iter . size_hint ( )
1296
1297
}
1298
+
1297
1299
fn last ( mut self ) -> Option < & ' a T > {
1298
1300
self . next_back ( )
1299
1301
}
1302
+
1303
+ fn min ( mut self ) -> Option < & ' a T > {
1304
+ self . next ( )
1305
+ }
1306
+
1307
+ fn max ( mut self ) -> Option < & ' a T > {
1308
+ self . next_back ( )
1309
+ }
1300
1310
}
1301
1311
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1302
1312
impl < ' a , T > DoubleEndedIterator for Iter < ' a , T > {
@@ -1321,6 +1331,7 @@ impl<T> Iterator for IntoIter<T> {
1321
1331
fn next ( & mut self ) -> Option < T > {
1322
1332
self . iter . next ( ) . map ( |( k, _) | k)
1323
1333
}
1334
+
1324
1335
fn size_hint ( & self ) -> ( usize , Option < usize > ) {
1325
1336
self . iter . size_hint ( )
1326
1337
}
@@ -1359,6 +1370,14 @@ impl<'a, T> Iterator for Range<'a, T> {
1359
1370
fn last ( mut self ) -> Option < & ' a T > {
1360
1371
self . next_back ( )
1361
1372
}
1373
+
1374
+ fn min ( mut self ) -> Option < & ' a T > {
1375
+ self . next ( )
1376
+ }
1377
+
1378
+ fn max ( mut self ) -> Option < & ' a T > {
1379
+ self . next_back ( )
1380
+ }
1362
1381
}
1363
1382
1364
1383
#[ stable( feature = "btree_range" , since = "1.17.0" ) ]
@@ -1429,6 +1448,10 @@ impl<'a, T: Ord> Iterator for Difference<'a, T> {
1429
1448
} ;
1430
1449
( self_len. saturating_sub ( other_len) , Some ( self_len) )
1431
1450
}
1451
+
1452
+ fn min ( mut self ) -> Option < & ' a T > {
1453
+ self . next ( )
1454
+ }
1432
1455
}
1433
1456
1434
1457
#[ stable( feature = "fused" , since = "1.26.0" ) ]
@@ -1460,6 +1483,10 @@ impl<'a, T: Ord> Iterator for SymmetricDifference<'a, T> {
1460
1483
// the number of elements to less than half the range of usize.
1461
1484
( 0 , Some ( a_len + b_len) )
1462
1485
}
1486
+
1487
+ fn min ( mut self ) -> Option < & ' a T > {
1488
+ self . next ( )
1489
+ }
1463
1490
}
1464
1491
1465
1492
#[ stable( feature = "fused" , since = "1.26.0" ) ]
@@ -1516,6 +1543,10 @@ impl<'a, T: Ord> Iterator for Intersection<'a, T> {
1516
1543
IntersectionInner :: Answer ( Some ( _) ) => ( 1 , Some ( 1 ) ) ,
1517
1544
}
1518
1545
}
1546
+
1547
+ fn min ( mut self ) -> Option < & ' a T > {
1548
+ self . next ( )
1549
+ }
1519
1550
}
1520
1551
1521
1552
#[ stable( feature = "fused" , since = "1.26.0" ) ]
@@ -1541,6 +1572,10 @@ impl<'a, T: Ord> Iterator for Union<'a, T> {
1541
1572
// No checked_add - see SymmetricDifference::size_hint.
1542
1573
( max ( a_len, b_len) , Some ( a_len + b_len) )
1543
1574
}
1575
+
1576
+ fn min ( mut self ) -> Option < & ' a T > {
1577
+ self . next ( )
1578
+ }
1544
1579
}
1545
1580
1546
1581
#[ stable( feature = "fused" , since = "1.26.0" ) ]
0 commit comments