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 7afbf18 + bde6dd9 commit 2b0c911Copy full SHA for 2b0c911
text/2523-cfg-path-version.md
@@ -91,6 +91,13 @@ fn make_iter(limit: u8) -> impl Iterator<Item = u8> {
91
(0..limit).map(move |x| (x..limit)).flatten()
92
}
93
94
+// Even better
95
+fn make_iter(limit: u8) -> impl Iterator<Item = u8> {
96
+ #[cfg(not(accessible(::std::iter::Flatten)))]
97
+ use itertools::Itertools;
98
+ (0..limit).map(move |x| (x..limit)).flatten()
99
+}
100
+
101
fn main() {
102
println!("{:?}", make_iter(10).collect::<Vec<_>>());
103
0 commit comments