Skip to content

Commit 039bc43

Browse files
committed
Bump Rust version to 1.88
1 parent 4c814e4 commit 039bc43

File tree

6 files changed

+28
-24
lines changed

6 files changed

+28
-24
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v4
23-
- run: rustup default 1.87
23+
- run: rustup default 1.88
2424
- run: cargo test
2525

2626
test-nightly:

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
url: ${{ steps.deployment.outputs.page_url }}
1919
steps:
2020
- uses: actions/checkout@v4
21-
- run: rustup default 1.87
21+
- run: rustup default 1.88
2222
- run: cargo doc
2323
env:
2424
RUSTDOCFLAGS: "--document-private-items --default-theme=ayu --deny warnings"

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "aoc"
33
version = "2024.12.25"
44
edition = "2024"
5-
rust-version = "1.87"
5+
rust-version = "1.88"
66

77
[features]
88
frivolity = []
@@ -119,6 +119,7 @@ get_unwrap = "warn"
119119
host_endian_bytes = "allow"
120120
if_not_else = "warn"
121121
if_then_some_else_none = "warn"
122+
ignore_without_reason = "warn"
122123
ignored_unit_patterns = "warn"
123124
impl_trait_in_params = "warn"
124125
implicit_clone = "warn"
@@ -136,6 +137,7 @@ integer_division = "allow"
136137
integer_division_remainder_used = "allow"
137138
into_iter_without_iter = "warn"
138139
invalid_upcast_comparisons = "warn"
140+
ip_constant = "warn"
139141
items_after_statements = "warn"
140142
iter_filter_is_ok = "warn"
141143
iter_filter_is_some = "warn"
@@ -194,7 +196,7 @@ mutex_atomic = "warn"
194196
naive_bytecount = "allow"
195197
needless_bitwise_bool = "warn"
196198
needless_continue = "warn"
197-
needless_for_each = "warn"
199+
needless_for_each = "allow"
198200
needless_pass_by_value = "warn"
199201
needless_raw_string_hashes = "warn"
200202
needless_raw_strings = "warn"
@@ -210,6 +212,7 @@ panic_in_result_fn = "warn"
210212
partial_pub_fields = "warn"
211213
pathbuf_init_then_push = "warn"
212214
pattern_type_mismatch = "allow"
215+
pointer_format = "warn"
213216
precedence_bits = "warn"
214217
print_stderr = "allow"
215218
print_stdout = "allow"
@@ -227,6 +230,7 @@ rc_buffer = "warn"
227230
rc_mutex = "warn"
228231
redundant_closure_for_method_calls = "warn"
229232
redundant_else = "warn"
233+
redundant_test_prefix = "warn"
230234
redundant_type_annotations = "warn"
231235
ref_as_ptr = "warn"
232236
ref_binding_to_reference = "warn"

src/year2018/day15.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ fn fight(input: &Input, elf_attack_power: i32, part_two: bool) -> Option<i32> {
216216

217217
// If no enemy next to unit then move towards nearest enemy in reading order,
218218
// breaking equal distance ties in reading order.
219-
if nearby.is_none() {
220-
if let Some(next) = double_bfs(input.walls, &units, position, kind) {
221-
grid[position] = None;
222-
grid[next] = Some(index);
223-
units[index].position = next;
224-
225-
nearby = attack(&grid, &units, next, kind);
226-
}
219+
if nearby.is_none()
220+
&& let Some(next) = double_bfs(input.walls, &units, position, kind)
221+
{
222+
grid[position] = None;
223+
grid[next] = Some(index);
224+
units[index].position = next;
225+
226+
nearby = attack(&grid, &units, next, kind);
227227
}
228228

229229
// Attack enemy if possible.

src/year2019/day18.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ fn parse_maze(width: i32, bytes: &[u8]) -> Maze {
140140
needed |= 1 << door;
141141
}
142142

143-
if let Some(to) = is_key(bytes[index]) {
144-
if distance > 0 {
145-
// Store the reciprocal edge weight and doors in the adjacency matrix.
146-
maze[from][to] = Door { distance, needed };
147-
maze[to][from] = Door { distance, needed };
148-
// Faster to stop here and use Floyd-Warshall later.
149-
continue;
150-
}
143+
if let Some(to) = is_key(bytes[index])
144+
&& distance > 0
145+
{
146+
// Store the reciprocal edge weight and doors in the adjacency matrix.
147+
maze[from][to] = Door { distance, needed };
148+
maze[to][from] = Door { distance, needed };
149+
// Faster to stop here and use Floyd-Warshall later.
150+
continue;
151151
}
152152

153153
for delta in orthogonal {

src/year2019/day20.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ pub fn part2(input: &Maze) -> u32 {
166166

167167
while let Some((steps, index, level)) = todo.pop_front() {
168168
let key = (index, level);
169-
if let Some(min) = cache.get(&key) {
170-
if *min <= steps {
171-
continue;
172-
}
169+
if let Some(min) = cache.get(&key)
170+
&& *min <= steps
171+
{
172+
continue;
173173
}
174174
cache.insert(key, steps);
175175

0 commit comments

Comments
 (0)