Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4c814e4

Browse files
Bump Rust version to 1.87
1 parent ff8eaeb commit 4c814e4

File tree

16 files changed

+27
-25
lines changed

16 files changed

+27
-25
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.86
23+
- run: rustup default 1.87
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.86
21+
- run: rustup default 1.87
2222
- run: cargo doc
2323
env:
2424
RUSTDOCFLAGS: "--document-private-items --default-theme=ayu --deny warnings"

‎Cargo.toml

Lines changed: 7 additions & 4 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.86"
5+
rust-version = "1.87"
66

77
[features]
88
frivolity = []
@@ -84,9 +84,11 @@ default_trait_access = "warn"
8484
default_union_representation = "warn"
8585
deref_by_slicing = "allow"
8686
disallowed_script_idents = "warn"
87+
doc_comment_double_space_linebreaks = "warn"
8788
doc_include_without_cfg = "warn"
8889
doc_link_with_quotes = "warn"
8990
doc_markdown = "warn"
91+
elidable_lifetime_names = "warn"
9092
else_if_without_else = "allow"
9193
empty_drop = "warn"
9294
empty_enum = "warn"
@@ -154,17 +156,17 @@ macro_use_imports = "warn"
154156
manual_assert = "warn"
155157
manual_c_str_literals = "warn"
156158
manual_instant_elapsed = "warn"
157-
manual_is_power_of_two = "warn"
159+
manual_is_power_of_two = "allow"
158160
manual_is_variant_and = "warn"
159161
manual_let_else = "warn"
162+
manual_midpoint = "warn"
160163
manual_ok_or = "warn"
161164
manual_string_new = "warn"
162165
many_single_char_names = "allow"
163166
map_err_ignore = "warn"
164167
map_unwrap_or = "warn"
165168
map_with_unused_argument_over_ranges = "warn"
166169
match_bool = "warn"
167-
match_on_vec_items = "allow"
168170
match_same_arms = "warn"
169171
match_wild_err_arm = "warn"
170172
match_wildcard_for_single_variants = "warn"
@@ -220,7 +222,7 @@ pub_without_shorthand = "warn"
220222
question_mark_used = "allow"
221223
range_minus_one = "warn"
222224
range_plus_one = "allow"
223-
return_and_then = "warn"
225+
return_and_then = "allow"
224226
rc_buffer = "warn"
225227
rc_mutex = "warn"
226228
redundant_closure_for_method_calls = "warn"
@@ -274,6 +276,7 @@ unicode_not_nfc = "warn"
274276
unimplemented = "warn"
275277
uninlined_format_args = "warn"
276278
unnecessary_box_returns = "warn"
279+
unnecessary_debug_formatting = "warn"
277280
unnecessary_join = "warn"
278281
unnecessary_literal_bound = "warn"
279282
unnecessary_safety_comment = "warn"

‎src/year2015/day03.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn part1(input: &[Point]) -> usize {
1818
}
1919

2020
pub fn part2(input: &[Point]) -> usize {
21-
deliver(input, |i| i % 2 == 0)
21+
deliver(input, |i| i.is_multiple_of(2))
2222
}
2323

2424
fn deliver(input: &[Point], predicate: fn(usize) -> bool) -> usize {

‎src/year2015/day23.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn execute(input: &[Op], mut a: u64) -> u64 {
7070
pc += 1;
7171
}
7272
Op::Jmp(index) => pc = index,
73-
Op::Jie(index) => pc = if a % 2 == 0 { index } else { pc + 1 },
73+
Op::Jie(index) => pc = if a.is_multiple_of(2) { index } else { pc + 1 },
7474
Op::Jio(index) => pc = if a == 1 { index } else { pc + 1 },
7575
}
7676
}

‎src/year2016/day13.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn parse(input: &str) -> Input {
2323
for y in 0..52 {
2424
let n = (x * x) + (3 * x) + (2 * x * y) + y + (y * y) + favorite;
2525
let ones = n.count_ones();
26-
maze[x][y] = ones % 2 == 0;
26+
maze[x][y] = ones.is_multiple_of(2);
2727
}
2828
}
2929

‎src/year2016/day16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn checksum(input: &[usize], step_size: usize) -> String {
6666
.map(|i| count(input, i * step_size))
6767
.collect::<Vec<_>>()
6868
.windows(2)
69-
.map(|w| if (w[1] - w[0]) % 2 == 0 { '1' } else { '0' })
69+
.map(|w| if (w[1] - w[0]).is_multiple_of(2) { '1' } else { '0' })
7070
.collect()
7171
}
7272

‎src/year2017/day05.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn part2(input: &[i32]) -> usize {
9090
// Each time it crosses a block of 16 add to the compact binary representation.
9191
if jump[index] == 2 && index == fine {
9292
fine += 1;
93-
if fine % 16 == 0 {
93+
if fine.is_multiple_of(16) {
9494
let value = (coarse..fine).rev().fold(0, |acc, i| (acc << 1) | (jump[i] & 1));
9595
coarse = fine;
9696
compact.push(value as u16);

‎src/year2017/day15.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ fn sender(shared: &Shared, tx: &Sender<Block>) {
8282
if left == right {
8383
ones += 1;
8484
}
85-
if left % 4 == 0 {
85+
if left.is_multiple_of(4) {
8686
fours.push(left);
8787
}
88-
if right % 8 == 0 {
88+
if right.is_multiple_of(8) {
8989
eights.push(right);
9090
}
9191
}

‎src/year2018/day23.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ impl Cube {
5757
let Cube { x1, x2, y1, y2, z1, z2 } = *self;
5858

5959
// Lower and upper halves of the new sub-cubes.
60-
let lx = (self.x1 + self.x2) / 2;
61-
let ly = (self.y1 + self.y2) / 2;
62-
let lz = (self.z1 + self.z2) / 2;
60+
let lx = self.x1.midpoint(self.x2);
61+
let ly = self.y1.midpoint(self.y2);
62+
let lz = self.z1.midpoint(self.z2);
6363
let ux = lx + 1;
6464
let uy = ly + 1;
6565
let uz = lz + 1;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /