Skip to content

Commit cd925c2

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

File tree

6 files changed

+33
-28
lines changed

6 files changed

+33
-28
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: 11 additions & 6 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 = []
@@ -58,6 +58,7 @@ allow_attributes_without_reason = "allow"
5858
arbitrary_source_item_ordering = "allow"
5959
arithmetic_side_effects = "allow"
6060
as_conversions = "allow"
61+
as_pointer_underscore = "warn"
6162
as_underscore = "warn"
6263
assertions_on_result_states = "warn"
6364
assigning_clones = "warn"
@@ -75,6 +76,7 @@ cfg_not_test = "warn"
7576
checked_conversions = "warn"
7677
clone_on_ref_ptr = "warn"
7778
cloned_instead_of_copied = "warn"
79+
comparison_chain = "warn"
7880
copy_iterator = "warn"
7981
create_dir = "warn"
8082
dbg_macro = "warn"
@@ -113,12 +115,14 @@ float_cmp = "warn"
113115
float_cmp_const = "warn"
114116
fn_params_excessive_bools = "warn"
115117
fn_to_numeric_cast_any = "warn"
118+
format_collect = "warn"
116119
format_push_string = "warn"
117120
from_iter_instead_of_collect = "warn"
118121
get_unwrap = "warn"
119122
host_endian_bytes = "allow"
120123
if_not_else = "warn"
121124
if_then_some_else_none = "warn"
125+
ignore_without_reason = "warn"
122126
ignored_unit_patterns = "warn"
123127
impl_trait_in_params = "warn"
124128
implicit_clone = "warn"
@@ -154,13 +158,11 @@ little_endian_bytes = "allow"
154158
lossy_float_literal = "warn"
155159
macro_use_imports = "warn"
156160
manual_assert = "warn"
157-
manual_c_str_literals = "warn"
158161
manual_instant_elapsed = "warn"
159162
manual_is_power_of_two = "allow"
160163
manual_is_variant_and = "warn"
161164
manual_let_else = "warn"
162165
manual_midpoint = "warn"
163-
manual_ok_or = "warn"
164166
manual_string_new = "warn"
165167
many_single_char_names = "allow"
166168
map_err_ignore = "warn"
@@ -191,10 +193,11 @@ multiple_unsafe_ops_per_block = "warn"
191193
must_use_candidate = "allow"
192194
mut_mut = "warn"
193195
mutex_atomic = "warn"
196+
mutex_integer = "warn"
194197
naive_bytecount = "allow"
195198
needless_bitwise_bool = "warn"
196199
needless_continue = "warn"
197-
needless_for_each = "warn"
200+
needless_for_each = "allow"
198201
needless_pass_by_value = "warn"
199202
needless_raw_string_hashes = "warn"
200203
needless_raw_strings = "warn"
@@ -222,18 +225,20 @@ pub_without_shorthand = "warn"
222225
question_mark_used = "allow"
223226
range_minus_one = "warn"
224227
range_plus_one = "allow"
225-
return_and_then = "allow"
226228
rc_buffer = "warn"
227229
rc_mutex = "warn"
228230
redundant_closure_for_method_calls = "warn"
229231
redundant_else = "warn"
232+
redundant_test_prefix = "warn"
230233
redundant_type_annotations = "warn"
231234
ref_as_ptr = "warn"
232235
ref_binding_to_reference = "warn"
233236
ref_option = "warn"
237+
ref_option_ref = "warn"
234238
ref_patterns = "warn"
235239
renamed_function_params = "warn"
236240
rest_pat_in_fully_bound_structs = "warn"
241+
return_and_then = "allow"
237242
return_self_not_must_use = "warn"
238243
same_functions_in_if_condition = "warn"
239244
same_name_method = "warn"
@@ -274,7 +279,6 @@ unchecked_duration_subtraction = "warn"
274279
undocumented_unsafe_blocks = "warn"
275280
unicode_not_nfc = "warn"
276281
unimplemented = "warn"
277-
uninlined_format_args = "warn"
278282
unnecessary_box_returns = "warn"
279283
unnecessary_debug_formatting = "warn"
280284
unnecessary_join = "warn"
@@ -297,6 +301,7 @@ unused_trait_names = "warn"
297301
unwrap_in_result = "allow"
298302
unwrap_used = "allow"
299303
use_debug = "warn"
304+
used_underscore_binding = "warn"
300305
used_underscore_items = "warn"
301306
verbose_bit_mask = "warn"
302307
verbose_file_reads = "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)