Skip to content

Commit 05b01cd

Browse files
committed
refactor: VecDeques IntoIter fields to private
1 parent e0c38af commit 05b01cd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

library/alloc/src/collections/vec_deque/into_iter.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ pub struct IntoIter<
1717
T,
1818
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
1919
> {
20-
pub(crate) inner: VecDeque<T, A>,
20+
inner: VecDeque<T, A>,
21+
}
22+
23+
impl<T, A: Allocator> IntoIter<T, A> {
24+
pub(super) fn new(inner: VecDeque<T, A>) -> Self {
25+
IntoIter { inner }
26+
}
2127
}
2228

2329
#[stable(feature = "collection_debug", since = "1.17.0")]

library/alloc/src/collections/vec_deque/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2827,7 +2827,7 @@ impl<T, A: Allocator> IntoIterator for VecDeque<T, A> {
28272827
/// Consumes the `VecDeque` into a front-to-back iterator yielding elements by
28282828
/// value.
28292829
fn into_iter(self) -> IntoIter<T, A> {
2830-
IntoIter { inner: self }
2830+
IntoIter::new(self)
28312831
}
28322832
}
28332833

0 commit comments

Comments
 (0)