Rollup merge of #89053 - DeveloperC286:into_iter_fields_to_private, r=Mark-Simulacrum
refactor: VecDeques IntoIter fields to private Made the fields of VecDeque's IntoIter private by creating a IntoIter::from(...) function to create a new instance of IntoIter and migrating usage to use IntoIter::from(...).
This commit is contained in:
commit
e4dbe27235
@ -17,7 +17,13 @@ pub struct IntoIter<
|
||||
T,
|
||||
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
|
||||
> {
|
||||
pub(crate) inner: VecDeque<T, A>,
|
||||
inner: VecDeque<T, A>,
|
||||
}
|
||||
|
||||
impl<T, A: Allocator> IntoIter<T, A> {
|
||||
pub(super) fn new(inner: VecDeque<T, A>) -> Self {
|
||||
IntoIter { inner }
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "collection_debug", since = "1.17.0")]
|
||||
|
@ -2827,7 +2827,7 @@ impl<T, A: Allocator> IntoIterator for VecDeque<T, A> {
|
||||
/// Consumes the `VecDeque` into a front-to-back iterator yielding elements by
|
||||
/// value.
|
||||
fn into_iter(self) -> IntoIter<T, A> {
|
||||
IntoIter { inner: self }
|
||||
IntoIter::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user