mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-23 07:20:20 +08:00
style: optimized ch13-02-iterators sample code
This commit is contained in:
parent
e3d20c06cb
commit
d7a6edefc8
@ -335,7 +335,8 @@ fn calling_next_directly() {
|
||||
#
|
||||
#[test]
|
||||
fn using_other_iterator_trait_methods() {
|
||||
let sum: u32 = Counter::new().zip(Counter::new().skip(1))
|
||||
let sum: u32 = Counter::new()
|
||||
.zip(Counter::new().skip(1))
|
||||
.map(|(a, b)| a * b)
|
||||
.filter(|x| x % 3 == 0)
|
||||
.sum();
|
||||
|
Loading…
Reference in New Issue
Block a user