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.
This commit is contained in:
commit
9ae7fb3e71
1 changed files with 3 additions and 0 deletions
|
|
@ -2703,6 +2703,9 @@ impl<T> ExactSizeIterator for Drain<'_, T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "trusted_len", issue = "37572")]
|
||||
unsafe impl<T> TrustedLen for Drain<'_, T> {}
|
||||
|
||||
#[stable(feature = "fused", since = "1.26.0")]
|
||||
impl<T> FusedIterator for Drain<'_, T> {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue