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 0e406ad

Browse files
Rust 2024 Edition
1 parent 47b39bf commit 0e406ad

File tree

9 files changed

+13
-17
lines changed

9 files changed

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

‎Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "aoc"
33
version = "2024年12月25日"
4-
edition = "2021"
5-
rust-version = "1.84"
4+
edition = "2024"
5+
rust-version = "1.85"
66

77
[features]
88
frivolity = []
@@ -14,9 +14,11 @@ private_intra_doc_links = "allow"
1414
[lints.rust]
1515
absolute_paths_not_starting_with_crate = "warn"
1616
ambiguous_negative_literals = "warn"
17+
closure-returning-async-block = "warn"
1718
elided_lifetimes_in_paths = "warn"
1819
explicit_outlives_requirements = "warn"
1920
ffi_unwind_calls = "warn"
21+
if-let-rescope = "warn"
2022
let_underscore_drop = "warn"
2123
macro_use_extern_crate = "warn"
2224
meta_variable_misuse = "warn"
@@ -26,7 +28,6 @@ missing_debug_implementations = "allow"
2628
missing_docs = "allow"
2729
missing_unsafe_on_extern = "warn"
2830
non_ascii_idents = "warn"
29-
non_local_definitions = "warn"
3031
redundant_imports = "warn"
3132
redundant_lifetimes = "warn"
3233
single_use_lifetimes = "warn"
@@ -83,6 +84,7 @@ default_trait_access = "warn"
8384
default_union_representation = "warn"
8485
deref_by_slicing = "allow"
8586
disallowed_script_idents = "warn"
87+
doc_include_without_cfg = "warn"
8688
doc_link_with_quotes = "warn"
8789
doc_markdown = "warn"
8890
else_if_without_else = "allow"

‎rustfmt.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
style_edition = "2024"
21
use_small_heuristics = "Max"

‎src/util/point.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ impl Point {
8686

8787
impl From<u8> for Point {
8888
#[inline]
89-
#[must_use]
9089
fn from(value: u8) -> Self {
9190
match value {
9291
b'^' | b'U' => UP,
@@ -110,7 +109,6 @@ impl Add for Point {
110109
type Output = Self;
111110

112111
#[inline]
113-
#[must_use]
114112
fn add(self, rhs: Self) -> Self {
115113
Point::new(self.x + rhs.x, self.y + rhs.y)
116114
}
@@ -128,7 +126,6 @@ impl Mul<i32> for Point {
128126
type Output = Self;
129127

130128
#[inline]
131-
#[must_use]
132129
fn mul(self, rhs: i32) -> Self {
133130
Point::new(self.x * rhs, self.y * rhs)
134131
}
@@ -138,7 +135,6 @@ impl Sub for Point {
138135
type Output = Self;
139136

140137
#[inline]
141-
#[must_use]
142138
fn sub(self, rhs: Self) -> Self {
143139
Point::new(self.x - rhs.x, self.y - rhs.y)
144140
}

‎src/year2019/day17.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub fn part2(input: &Input) -> i64 {
100100
let path = build_path(input);
101101
let mut movement = Movement { routine: String::new(), functions: [None; 3] };
102102

103-
compress(&path, &mut movement);
103+
let _unused = compress(&path, &mut movement);
104104

105105
// Convert trailing comma ',' into a trailing newline '\n'
106106
let mut rules = String::new();

‎src/year2019/day25.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fn play_automatically(input: &[i64]) -> String {
134134
too_light.insert(current);
135135
continue;
136136
}
137-
};
137+
}
138138

139139
if matches!(movement_noisy(&mut computer, &last, &mut output), State::Halted) {
140140
// Keep only the password digits from Santa's response.

‎src/year2021/day19.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,9 @@ pub fn parse(input: &str) -> Vec<Located> {
191191
let mut next_unknown = Vec::new();
192192

193193
while let Some(scanner) = unknown.pop() {
194-
if let Some(found) = check(&known, &scanner) {
195-
todo.push(Located::from(scanner, found));
196-
} else {
197-
next_unknown.push(scanner);
194+
match check(&known, &scanner) {
195+
Some(found) => todo.push(Located::from(scanner, found)),
196+
None => next_unknown.push(scanner),
198197
}
199198
}
200199

‎src/year2022/day17.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl Iterator for State<'_> {
9696
// Check for a horizontal collision (this does not prevent downwards movement).
9797
if candidate & chunk == 0 {
9898
shape = candidate;
99-
};
99+
}
100100

101101
// The neat part of using bitwise AND to compare is that we can check all four
102102
// rows in a single operation, including both walls and the existing tower.

0 commit comments

Comments
(0)

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