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.
1 parent a6a4c60 commit e7db51bCopy full SHA for e7db51b
src/lib.rs
@@ -15,6 +15,16 @@
15
//! }
16
//! ```
17
//!
18
+//! However, **make sure to only use the above form with a mutable reference to an existing iterator**.
19
+//! For example, the following code will loop forever over the first element of the array:
20
+//!
21
+//! ```ignore
22
+//! let array = [0, 1, 2, 3];
23
+//! while let Some(item) = convert(array.iter()).next() {
24
+//! // This is an infinite loop!
25
+//! }
26
+//! ```
27
28
//! While the standard `Iterator` trait's functionality is based off of the `next` method,
29
//! `StreamingIterator`'s functionality is based off of a pair of methods: `advance` and `get`. This
30
//! essentially splits the logic of `next` in half (in fact, `StreamingIterator`'s `next` method
0 commit comments