diff options
author | Yigit Sever | 2022-12-01 17:44:53 +0300 |
---|---|---|
committer | Yigit Sever | 2022-12-01 17:44:53 +0300 |
commit | dcb1c08422a46f1f43d7002a3d4790b713dd9eab (patch) | |
tree | 129ed6567d7db2feee87db1ec07682ba9c03cd1f /2022/day1/part2/src/main.rs | |
parent | 5055786d3db80e45a5c3f128f41866ea78865c45 (diff) | |
download | aoc-dcb1c08422a46f1f43d7002a3d4790b713dd9eab.tar.gz aoc-dcb1c08422a46f1f43d7002a3d4790b713dd9eab.tar.bz2 aoc-dcb1c08422a46f1f43d7002a3d4790b713dd9eab.zip |
2022, day1: clippy
Diffstat (limited to '2022/day1/part2/src/main.rs')
-rw-r--r-- | 2022/day1/part2/src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/2022/day1/part2/src/main.rs b/2022/day1/part2/src/main.rs index 2a65d1a..62175ab 100644 --- a/2022/day1/part2/src/main.rs +++ b/2022/day1/part2/src/main.rs | |||
@@ -4,7 +4,7 @@ fn main() { | |||
4 | let input: String = include_str!("../../input").to_string(); | 4 | let input: String = include_str!("../../input").to_string(); |
5 | let mut calories: Vec<usize> = Vec::new(); | 5 | let mut calories: Vec<usize> = Vec::new(); |
6 | 6 | ||
7 | for (key, group) in &input.lines().group_by(|line| *line != "") { | 7 | for (key, group) in &input.lines().group_by(|line| line.is_empty()) { |
8 | if key { | 8 | if key { |
9 | calories.push(group.into_iter().map(|i| i.parse::<usize>().unwrap()).sum()); | 9 | calories.push(group.into_iter().map(|i| i.parse::<usize>().unwrap()).sum()); |
10 | } | 10 | } |