1
Fork 0

add Iterator::flatten and redefine flat_map(f) in terms of map(f).flatten()

This commit is contained in:
Mazdak Farrokhzad 2018-02-20 08:26:30 +01:00
parent 27a046e933
commit 6af23f977c
4 changed files with 84 additions and 47 deletions

View file

@ -836,6 +836,8 @@ fn test_iterator_scan() {
assert_eq!(i, ys.len());
}
// Note: We test flatten() by testing flat_map().
#[test]
fn test_iterator_flat_map() {
let xs = [0, 3, 6];