Skip to content

Commit 9ae7fb3

Browse files
authored
Rollup merge of #66759 - CAD97:patch-3, r=KodrAus
impl TrustedLen for vec::Drain The iterator methods just forward to `slice::Iter`, which is `TrustedLen`. This can probably be applied to other `Drain` structs as well.
2 parents 123406c + f8a4b6d commit 9ae7fb3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/liballoc/vec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,6 +2703,9 @@ impl<T> ExactSizeIterator for Drain<'_, T> {
27032703
}
27042704
}
27052705

2706+
#[unstable(feature = "trusted_len", issue = "37572")]
2707+
unsafe impl<T> TrustedLen for Drain<'_, T> {}
2708+
27062709
#[stable(feature = "fused", since = "1.26.0")]
27072710
impl<T> FusedIterator for Drain<'_, T> {}
27082711

0 commit comments

Comments
 (0)