We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e8622d0 + 80ab250 commit 8c030b9Copy full SHA for 8c030b9
library/core/src/iter/adapters/rev.rs
@@ -20,6 +20,24 @@ impl<T> Rev<T> {
20
pub(in crate::iter) fn new(iter: T) -> Rev<T> {
21
Rev { iter }
22
}
23
+
24
+ /// Consumes the `Rev`, returning the inner iterator.
25
+ ///
26
+ /// # Examples
27
28
+ /// ```rust
29
+ /// #![feature(rev_into_inner)]
30
31
+ /// let s = "foo";
32
+ /// let mut rev = s.chars().rev();
33
+ /// rev.next();
34
35
+ /// assert_eq!(rev.into_inner().collect::<String>(), "f");
36
+ /// ```
37
+ #[unstable(feature = "rev_into_inner", issue = "144277")]
38
+ pub fn into_inner(self) -> T {
39
+ self.iter
40
+ }
41
42
43
#[stable(feature = "rust1", since = "1.0.0")]
0 commit comments