Skip to content

Commit

Permalink
Fix overflow panics
Browse files Browse the repository at this point in the history
  • Loading branch information
connorslade committed Nov 29, 2024
1 parent 30b1232 commit 1f057a3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ clap = { version = "4.0.29", features = ["derive"] }
chrono = "0.4.31"
anyhow = "1.0.75"


[profile.release]
overflow-checks = true
incremental = true
2 changes: 1 addition & 1 deletion aoc_2021/src/day_10.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn part_b(input: &str) -> Answer {
}

if !is_corrupted {
let mut score = 0;
let mut score = 0u64;
while let Some(ch) = queue.pop() {
score = 5 * score
+ match ch {
Expand Down
2 changes: 1 addition & 1 deletion aoc_2022/src/day_19.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl State {
fn tick(self) -> Self {
let mut resources = self.resources;
for (i, resource) in resources.iter_mut().enumerate() {
*resource += self.robots[i];
*resource = resource.saturating_add(self.robots[i]);
}

Self { resources, ..self }
Expand Down
2 changes: 1 addition & 1 deletion aoc_2022/src/day_23.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use hashbrown::{hash_map::Entry, HashMap, HashSet};
use common::{solution, Answer};
use nd_vec::vector;

solution!("Unstable Diffusion", 32);
solution!("Unstable Diffusion", 23);

type Point = nd_vec::Vec2<isize>;

Expand Down

0 comments on commit 1f057a3

Please sign in to comment.