refactor: VecDeques IntoIter fields to private

This commit is contained in:
DeveloperC286 2021-09-17 20:48:34 +01:00
parent e0c38af27c
commit 05b01cd787
2 changed files with 8 additions and 2 deletions

View file

@ -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")]

View file

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