From b273a8522cdb685d8c7e4e6e22c9d93362710fcb Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sun, 6 Dec 2020 02:29:32 -0800 Subject: remove redundant calls to trim() --- 01/src/main.rs | 1 + 03/src/main.rs | 2 +- 04/src/main.rs | 2 +- 06/src/main.rs | 3 +-- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/01/src/main.rs b/01/src/main.rs index 21c164b..b7cdbbf 100644 --- a/01/src/main.rs +++ b/01/src/main.rs @@ -65,3 +65,4 @@ fn main() -> Result<()> { Ok(()) } + diff --git a/03/src/main.rs b/03/src/main.rs index b8621da..2f07f44 100644 --- a/03/src/main.rs +++ b/03/src/main.rs @@ -16,7 +16,7 @@ fn main() -> Result<()> { for line in &input { let mut tree_line: Vec = Vec::new(); - for c in line.trim().chars() { + for c in line.chars() { if c == '#' { tree_line.push(true); } else { diff --git a/04/src/main.rs b/04/src/main.rs index 701f60d..9444725 100644 --- a/04/src/main.rs +++ b/04/src/main.rs @@ -26,7 +26,7 @@ fn main() -> Result<()> { let mut current_is_valid = true; for line in &input { - if line.trim().len() == 0 { + if line.len() == 0 { //println!("{:?}", current_fields); if current_is_valid diff --git a/06/src/main.rs b/06/src/main.rs index 00d065c..c0045e0 100644 --- a/06/src/main.rs +++ b/06/src/main.rs @@ -12,8 +12,7 @@ fn main() -> Result<()> { let filename = args.next().unwrap(); let input = advent_lib::read_lines_file(&filename)?; - let trimmed = advent_lib::trim_lines(&input); - let groups = advent_lib::group_lines_by_blanks(trimmed); + let groups = advent_lib::group_lines_by_blanks(input); let mut unioned_sum = 0; -- cgit 1.4.1