[rs] Don't trim lines unnecessarily

This commit is contained in:
Joscha 2022-12-03 13:20:12 +01:00
parent f0669d159f
commit 58d59ecd97
2 changed files with 2 additions and 5 deletions

View file

@ -71,10 +71,7 @@ fn read_round(line: &str) -> (Choice, Choice, Outcome) {
} }
pub fn solve(input: String) { pub fn solve(input: String) {
let matches = input let matches = input.lines().map(read_round).collect::<Vec<_>>();
.lines()
.map(|l| read_round(l.trim()))
.collect::<Vec<_>>();
// Part 1 // Part 1
let score = matches let score = matches

View file

@ -16,7 +16,7 @@ fn highest_score(i: u64) -> u32 {
} }
pub fn solve(input: String) { pub fn solve(input: String) {
let backpacks = input.lines().map(|l| l.trim()).collect::<Vec<_>>(); let backpacks = input.lines().collect::<Vec<_>>();
// Part 1 // Part 1
let score = backpacks let score = backpacks