Commit

Author:

Hash:

Timestamp:

+36 -39 +/-19 browse

Kevin Schoon [me@kevinschoon.com]

ed3aacb36fe61db5db7fc028d0374ea44f2c0e4f

Mon, 06 Oct 2025 20:18:45 +0000 (1 month ago)

bump rust edition to 2024, eliminate explicit rust version constraints
1diff --git a/ayllu-build/Cargo.toml b/ayllu-build/Cargo.toml
2index 83886cd..27d994d 100644
3--- a/ayllu-build/Cargo.toml
4+++ b/ayllu-build/Cargo.toml
5 @@ -1,7 +1,7 @@
6 [package]
7 name = "ayllu-build"
8 version = "0.2.1"
9- edition = "2021"
10+ edition = "2024"
11
12 [[bin]]
13 name = "ayllu-build"
14 diff --git a/ayllu-build/src/main.rs b/ayllu-build/src/main.rs
15index 70d2486..8b9ea89 100644
16--- a/ayllu-build/src/main.rs
17+++ b/ayllu-build/src/main.rs
18 @@ -1,8 +1,8 @@
19 use std::io::stdout;
20 use std::path::{Path, PathBuf};
21
22- use clap::{arg, Command, CommandFactory, Parser, Subcommand};
23- use clap_complete::{generate, Generator, Shell};
24+ use clap::{Command, CommandFactory, Parser, Subcommand, arg};
25+ use clap_complete::{Generator, Shell, generate};
26 use tracing::Level;
27
28 use ayllu_database::Builder;
29 @@ -51,8 +51,8 @@ enum Commands {
30 },
31 }
32
33- fn print_completions<G: Generator>(gen: G, cmd: &mut Command) {
34- generate(gen, cmd, cmd.get_name().to_string(), &mut stdout());
35+ fn print_completions<G: Generator>(generator: G, cmd: &mut Command) {
36+ generate(generator, cmd, cmd.get_name().to_string(), &mut stdout());
37 }
38
39 #[tokio::main(flavor = "current_thread")]
40 diff --git a/ayllu-jobs/Cargo.toml b/ayllu-jobs/Cargo.toml
41index cdec75c..7d43869 100644
42--- a/ayllu-jobs/Cargo.toml
43+++ b/ayllu-jobs/Cargo.toml
44 @@ -1,7 +1,7 @@
45 [package]
46 name = "ayllu-jobs"
47 version = "0.1.0"
48- edition = "2021"
49+ edition = "2024"
50
51 [dependencies]
52 ayllu_api = { path = "../crates/api" }
53 diff --git a/ayllu-keys/Cargo.toml b/ayllu-keys/Cargo.toml
54index fca312b..ccee6ec 100644
55--- a/ayllu-keys/Cargo.toml
56+++ b/ayllu-keys/Cargo.toml
57 @@ -1,7 +1,7 @@
58 [package]
59 name = "ayllu-keys"
60 version = "0.5.1"
61- edition = "2021"
62+ edition = "2024"
63
64 [dependencies]
65
66 diff --git a/ayllu-mail/Cargo.toml b/ayllu-mail/Cargo.toml
67index 33b0051..0967ccf 100644
68--- a/ayllu-mail/Cargo.toml
69+++ b/ayllu-mail/Cargo.toml
70 @@ -1,7 +1,7 @@
71 [package]
72 name = "ayllu-mail"
73 version = "0.2.1"
74- edition = "2021"
75+ edition = "2024"
76
77 [[bin]]
78 name = "ayllu-mail"
79 diff --git a/ayllu-shell/Cargo.toml b/ayllu-shell/Cargo.toml
80index 97cf2cd..368c811 100644
81--- a/ayllu-shell/Cargo.toml
82+++ b/ayllu-shell/Cargo.toml
83 @@ -1,7 +1,7 @@
84 [package]
85 name = "ayllu-shell"
86 version = "0.5.1"
87- edition = "2021"
88+ edition = "2024"
89
90 [dependencies]
91
92 diff --git a/ayllu-xmpp/Cargo.toml b/ayllu-xmpp/Cargo.toml
93index 7a5e342..56ec9dd 100644
94--- a/ayllu-xmpp/Cargo.toml
95+++ b/ayllu-xmpp/Cargo.toml
96 @@ -1,7 +1,7 @@
97 [package]
98 name = "ayllu-xmpp"
99 version = "0.2.1"
100- edition = "2021"
101+ edition = "2024"
102
103 [[bin]]
104 name = "ayllu-xmpp"
105 diff --git a/ayllu/Cargo.toml b/ayllu/Cargo.toml
106index 952295b..a222cfd 100644
107--- a/ayllu/Cargo.toml
108+++ b/ayllu/Cargo.toml
109 @@ -1,8 +1,7 @@
110 [package]
111 name = "ayllu"
112 version = "0.5.1"
113- edition = "2021"
114- rust-version = "1.83.0"
115+ edition = "2024"
116
117 [[bin]]
118 name = "ayllu"
119 diff --git a/ayllu/src/highlight.rs b/ayllu/src/highlight.rs
120index d81d51e..4618571 100644
121--- a/ayllu/src/highlight.rs
122+++ b/ayllu/src/highlight.rs
123 @@ -44,15 +44,15 @@ lazy_static! {
124 }
125
126 unsafe fn load_language(path: &str, hint: &Hint) -> Language {
127- let lib = libloading::Library::new(path).unwrap();
128+ let lib = unsafe { libloading::Library::new(path).unwrap() };
129 // rewrite any dash in the module name to use snakecase as is the convention
130 // for tree-sitter function names.
131 let method_name = format!("tree_sitter_{}", hint.0.to_lowercase().replace('-', "_"));
132 // NOTE: maybe, probably? some security auditing that needs to happen here?
133 tracing::debug!("attempting to load method: {method_name}");
134 let func: libloading::Symbol<unsafe extern "C" fn() -> Language> =
135- lib.get(method_name.as_bytes()).unwrap();
136- let language = func();
137+ unsafe { lib.get(method_name.as_bytes()).unwrap() };
138+ let language = unsafe { func() };
139 mem::forget(lib);
140 language
141 }
142 @@ -250,11 +250,7 @@ fn render_lines(lines: Vec<&str>, show_line_numbers: bool) -> String {
143 } else {
144 write!(&mut file, "<tr><td class=line>{line}</td></tr>").unwrap();
145 }
146- if n_chars > accm {
147- n_chars
148- } else {
149- accm
150- }
151+ if n_chars > accm { n_chars } else { accm }
152 });
153 let rows = String::from_utf8(file.into_inner()).unwrap();
154 format!(
155 diff --git a/ayllu/src/readme.rs b/ayllu/src/readme.rs
156index 5cd8764..d8d4e72 100644
157--- a/ayllu/src/readme.rs
158+++ b/ayllu/src/readme.rs
159 @@ -1,10 +1,11 @@
160 use std::path::Path;
161
162 use comrak::{
163+ Anchorizer, Arena, ComrakOptions, ComrakPlugins,
164 adapters::HeadingAdapter,
165 format_html_with_plugins,
166 nodes::{AstNode, NodeLink, NodeValue},
167- parse_document, Anchorizer, Arena, ComrakOptions, ComrakPlugins,
168+ parse_document,
169 };
170 use url::Url;
171
172 @@ -120,7 +121,7 @@ impl Renderer<'_> {
173 }
174
175 iter_nodes(root, &|node| match &mut node.data.borrow_mut().value {
176- NodeValue::Link(ref mut link) => {
177+ NodeValue::Link(link) => {
178 if let Some(rewrite) = Renderer::rewrite_url(
179 self.collection,
180 self.name,
181 @@ -134,7 +135,7 @@ impl Renderer<'_> {
182 };
183 }
184 }
185- NodeValue::Image(ref mut link) => {
186+ NodeValue::Image(link) => {
187 if let Some(rewrite) = Renderer::rewrite_url(
188 self.collection,
189 self.name,
190 @@ -229,7 +230,9 @@ ddddeeeeffffggg
191 assert!(result.contains(
192 "<img src=\"/projects/ayllu/raw/main/./aaaa/baz/\" alt=\"baz\" title=\"hmmm\" />"
193 ));
194- assert!(result
195- .contains("<img src=\"/projects/ayllu/raw/main/./bbbb/cccc/qux/\" alt=\"qux\" />"));
196+ assert!(
197+ result
198+ .contains("<img src=\"/projects/ayllu/raw/main/./bbbb/cccc/qux/\" alt=\"qux\" />")
199+ );
200 }
201 }
202 diff --git a/crates/api/Cargo.toml b/crates/api/Cargo.toml
203index 9456f75..3d6960a 100644
204--- a/crates/api/Cargo.toml
205+++ b/crates/api/Cargo.toml
206 @@ -1,7 +1,7 @@
207 [package]
208 name = "ayllu_api"
209 version = "0.2.1"
210- edition = "2021"
211+ edition = "2024"
212
213 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
214
215 diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml
216index 9d1a6ca..7d3522a 100644
217--- a/crates/config/Cargo.toml
218+++ b/crates/config/Cargo.toml
219 @@ -1,7 +1,7 @@
220 [package]
221 name = "ayllu_config"
222 version = "0.2.1"
223- edition = "2021"
224+ edition = "2024"
225
226 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
227
228 diff --git a/crates/database/Cargo.toml b/crates/database/Cargo.toml
229index d7a1022..cd94a87 100644
230--- a/crates/database/Cargo.toml
231+++ b/crates/database/Cargo.toml
232 @@ -1,7 +1,7 @@
233 [package]
234 name = "ayllu_database"
235 version = "0.2.1"
236- edition = "2021"
237+ edition = "2024"
238
239 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
240
241 diff --git a/crates/git/Cargo.toml b/crates/git/Cargo.toml
242index 963fb1e..8962e53 100644
243--- a/crates/git/Cargo.toml
244+++ b/crates/git/Cargo.toml
245 @@ -1,8 +1,7 @@
246 [package]
247 name = "ayllu_git"
248 version = "0.2.1"
249- edition = "2021"
250- rust-version = "1.70.0"
251+ edition = "2024"
252
253 [dependencies]
254 git2 = { workspace = true }
255 diff --git a/crates/git/src/error.rs b/crates/git/src/error.rs
256index 8a93bd4..3b85065 100644
257--- a/crates/git/src/error.rs
258+++ b/crates/git/src/error.rs
259 @@ -24,8 +24,8 @@ impl Error {
260 /// determines if the error looks like a missing resource
261 pub fn not_found(&self) -> bool {
262 match self {
263- Error::Git(ref err) => err.code() == GitErrorCode::NotFound,
264- Error::Io(ref err) => err.kind() == IoErrorKind::NotFound,
265+ Error::Git(err) => err.code() == GitErrorCode::NotFound,
266+ Error::Io(err) => err.kind() == IoErrorKind::NotFound,
267 Error::CannotOpenRepository { path: _, git_error } => {
268 git_error.code() == GitErrorCode::NotFound
269 }
270 @@ -49,13 +49,13 @@ impl From<IoError> for Error {
271 impl Display for Error {
272 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
273 match self {
274- Error::Git(ref err) => write!(f, "libgit operation failed: {err}"),
275- Error::Io(ref err) => err.fmt(f),
276+ Error::Git(err) => write!(f, "libgit operation failed: {err}"),
277+ Error::Io(err) => err.fmt(f),
278 Error::BlobTooLarge => write!(f, "blob is too large"),
279 Error::BlobIsBinary => write!(f, "blob is a binary file"),
280 Error::ObjectNotATree => write!(f, "object is not a tree"),
281 Error::NotAReference => write!(f, "reference is invalid"),
282- Error::ConfigError(ref msg) => write!(f, "config is invalid: {msg}"),
283+ Error::ConfigError(msg) => write!(f, "config is invalid: {msg}"),
284 Error::CannotOpenRepository { path, git_error } => {
285 write!(f, "could not open repository {path:?}: {git_error:?}")
286 }
287 diff --git a/crates/logging/Cargo.toml b/crates/logging/Cargo.toml
288index d222d87..ddd200b 100644
289--- a/crates/logging/Cargo.toml
290+++ b/crates/logging/Cargo.toml
291 @@ -1,7 +1,7 @@
292 [package]
293 name = "ayllu_logging"
294 version = "0.1.0"
295- edition = "2021"
296+ edition = "2024"
297
298 [dependencies]
299
300 diff --git a/crates/scheduler/Cargo.toml b/crates/scheduler/Cargo.toml
301index f1bba26..0ee043b 100644
302--- a/crates/scheduler/Cargo.toml
303+++ b/crates/scheduler/Cargo.toml
304 @@ -1,7 +1,7 @@
305 [package]
306 name = "ayllu_scheduler"
307 version = "0.2.1"
308- edition = "2021"
309+ edition = "2024"
310
311 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
312
313 diff --git a/crates/timeutil/Cargo.toml b/crates/timeutil/Cargo.toml
314index 3163c00..ab3d11f 100644
315--- a/crates/timeutil/Cargo.toml
316+++ b/crates/timeutil/Cargo.toml
317 @@ -1,7 +1,7 @@
318 [package]
319 name = "timeutil"
320 version = "0.1.0"
321- edition = "2021"
322+ edition = "2024"
323
324 [dependencies]
325 time = { version = "0.3.41", features = ["formatting"] }
326 diff --git a/quipu/Cargo.toml b/quipu/Cargo.toml
327index 2a29996..5170579 100644
328--- a/quipu/Cargo.toml
329+++ b/quipu/Cargo.toml
330 @@ -1,7 +1,7 @@
331 [package]
332 name = "quipu"
333 version = "0.5.1"
334- edition = "2021"
335+ edition = "2024"
336
337 [[bin]]
338 name = "quipu"