heh
bendn 2023-12-11
parent 87b1ebb · commit 32b84a1
-rw-r--r--Cargo.toml1
-rw-r--r--src/main.rs36
2 files changed, 14 insertions, 23 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 82ab709..14af4b6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,7 +8,6 @@ edition = "2021"
[dependencies]
itertools = "0.12.0"
memchr = "2.6.4"
-rayon = "1.8.0"
[profile.release]
lto = true
codegen-units = 1
diff --git a/src/main.rs b/src/main.rs
index 4c12878..a997596 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -181,40 +181,32 @@ impl Map<'_> {
fn turn(&self, p: Pipe, d: &mut D) {
use D::*;
- #[rustfmt::skip]
- macro_rules! n { () => { *d = N }; }
- #[rustfmt::skip]
- macro_rules! e { () => { *d = E }; }
- #[rustfmt::skip]
- macro_rules! s { () => { *d = S }; }
- #[rustfmt::skip]
- macro_rules! w { () => { *d = W }; }
- mat!(p {
+ *d = mat!(p {
Pipe::EW => mat!(d {
- E => e!(), // keep going east
- W => w!(), // keep going west
+ E => E, // keep going east
+ W => W, // keep going west
}),
Pipe::NW => mat!(d {
- E => n!(), // start going north
- S => w!(), // start going west
+ E => N, // start going north
+ S => W, // start going west
}),
Pipe::SW => mat!(d {
- E => s!(), // start going south
- N => w!(), // start going west
+ E => S, // start going south
+ N => W, // start going west
}),
Pipe::SE => mat!(d {
- N => e!(), // start going east
- W => s!(), // start going south
+ N => E, // start going east
+ W => S, // start going south
}),
Pipe::NS => mat!(d {
- N => n!(), // keep going north
- S => s!(), // keep going south
+ N => N, // keep going north
+ S => S, // keep going south
}),
Pipe::NE => mat!(d {
- W => n!(), // start going north
- S => e!(), // start going east
+ W => N, // start going north
+ S => E, // start going east
}),
- })
+ });
}
fn p2(&self) -> usize {