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:
Mazdak Farrokhzad 2019-11-30 16:56:49 +01:00 committed by GitHub
commit 9ae7fb3e71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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> {}