diff --git a/rust/series/src/lib.rs b/rust/series/src/lib.rs index 23d894e9..7994252a 100644 --- a/rust/series/src/lib.rs +++ b/rust/series/src/lib.rs @@ -3,8 +3,10 @@ pub fn series(digits: &str, len: usize) -> Vec { return vec![]; } - let windows: Vec<&str> = (0..=digits.len() - len) - .map(|i| &digits[i..i + len]) - .collect(); - windows.iter().map(|&s| s.to_string()).collect() + (0..=digits.len() - len) + .map(|i| &digits[i..i + len]) + .collect::>() + .iter() + .map(|&s| s.to_string()) + .collect() }