refactor: moving AsIntoIter into into_iter.rs
This commit is contained in:
parent
93613901d0
commit
2a1248976a
2 changed files with 16 additions and 15 deletions
|
@ -93,6 +93,7 @@ mod cow;
|
|||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub use self::into_iter::IntoIter;
|
||||
pub (crate) use self::into_iter::AsIntoIter;
|
||||
|
||||
mod into_iter;
|
||||
|
||||
|
@ -3019,18 +3020,3 @@ impl<T, A: Allocator, const N: usize> TryFrom<Vec<T, A>> for [T; N] {
|
|||
Ok(array)
|
||||
}
|
||||
}
|
||||
|
||||
// internal helper trait for in-place iteration specialization.
|
||||
#[rustc_specialization_trait]
|
||||
pub(crate) trait AsIntoIter {
|
||||
type Item;
|
||||
fn as_into_iter(&mut self) -> &mut IntoIter<Self::Item>;
|
||||
}
|
||||
|
||||
impl<T> AsIntoIter for IntoIter<T> {
|
||||
type Item = T;
|
||||
|
||||
fn as_into_iter(&mut self) -> &mut IntoIter<Self::Item> {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue