chore(rs): refactor reading ‹Vec<T>›

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2023-07-29 19:48:45 +02:00
parent b48cdc97f9
commit b9135e34a2
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -288,13 +288,7 @@ mod input {
}
pub fn next_vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
let mut arr = vec![];
for _ in 0..n {
arr.push(self.next::<T>());
}
arr
(0..n).map(|_| self.next()).collect()
}
}
}