Skip to content

Commit 8cf3305

Browse files
Cleanup old 2023 solutions
1 parent 4955942 commit 8cf3305

File tree

11 files changed

+12
-377
lines changed

11 files changed

+12
-377
lines changed

2023/day16/src/main.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ fn energize(start: (i32, i32, i32, i32), grid: &[u8], w: usize, h: usize) -> usi
7373

7474
fn main() {
7575
let input = fs::read_to_string("input.txt").expect("Could not read file");
76-
let lines: Vec<&str> = input.lines().collect();
77-
let grid: Vec<u8> = lines.iter().flat_map(|&l| l.as_bytes().to_vec()).collect();
76+
let lines = input.lines().collect::<Vec<_>>();
77+
let grid = lines
78+
.iter()
79+
.flat_map(|l| l.as_bytes())
80+
.copied()
81+
.collect::<Vec<_>>();
7882
let w = lines[0].len();
7983
let h = lines.len();
8084

2023/day23/src/main.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,12 @@ fn insert_edge(
6464
fn main() {
6565
for part1 in [true, false] {
6666
let input = fs::read_to_string("input.txt").expect("Could not read file");
67-
let lines: Vec<&str> = input.lines().collect();
68-
let grid: Vec<u8> = lines.iter().flat_map(|&l| l.as_bytes().to_vec()).collect();
67+
let lines = input.lines().collect::<Vec<_>>();
68+
let grid = lines
69+
.iter()
70+
.flat_map(|l| l.as_bytes())
71+
.copied()
72+
.collect::<Vec<_>>();
6973
let w = lines[0].len();
7074
let h = lines.len();
7175

File renamed without changes.
File renamed without changes.
File renamed without changes.

day23/Cargo.lock

-7
This file was deleted.

day23/Cargo.toml

-4
This file was deleted.

day23/src/main.rs

-219
This file was deleted.

day25/Cargo.lock

-7
This file was deleted.

day25/Cargo.toml

-4
This file was deleted.

0 commit comments

Comments
 (0)