rust: 1.97.1 → 1.98.0

The changes to `**/args.rs` are due to better linting: Clippy found that
we may use `as_chunks`. Note that this function was stabilized in 1.88.0.
This commit is contained in:
Lorenz Leutgeb
2026-08-30 14:28:36 +02:00
parent 7f5de25223
commit de43682f16
5 changed files with 15 additions and 21 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ pre_plan:
# This channel is also defined in `rust-toolchain.toml` – which hopefully can # This channel is also defined in `rust-toolchain.toml` – which hopefully can
# be supported by ambient in the future. # be supported by ambient in the future.
- action: rustup - action: rustup
channel: 1.97.1 channel: 1.98.0
plan: plan:
# Remove the components from rust-toolchain.toml. This works around the # Remove the components from rust-toolchain.toml. This works around the
+3 -7
View File
@@ -204,17 +204,13 @@ where
{ {
// `clap` ensures we have 2 values per option occurrence, // `clap` ensures we have 2 values per option occurrence,
// so we can chunk the aggregated slice exactly. // so we can chunk the aggregated slice exactly.
let chunks = values.chunks_exact(2); let (chunks, remainder) = values.as_chunks::<2>();
assert!(chunks.remainder().is_empty()); assert!(remainder.is_empty());
chunks.map(|chunk| { chunks.iter().map(|chunk| Embed {
// Slice accesses will not panic, guaranteed by `chunks_exact(2)`.
#[allow(clippy::indexing_slicing)]
Embed {
name: chunk[0].to_string(), name: chunk[0].to_string(),
content: EmbedContent::from(T::from(chunk[1].clone())), content: EmbedContent::from(T::from(chunk[1].clone())),
}
}) })
} }
+4 -6
View File
@@ -49,13 +49,11 @@ pub(super) fn parse_many_upserts(
) -> impl Iterator<Item = Result<PayloadUpsert, PayloadUpsertParseError>> + use<'_> { ) -> impl Iterator<Item = Result<PayloadUpsert, PayloadUpsertParseError>> + use<'_> {
// `clap` ensures we have 3 values per option occurrence, // `clap` ensures we have 3 values per option occurrence,
// so we can chunk the aggregated slice exactly. // so we can chunk the aggregated slice exactly.
let chunks = values.chunks_exact(3); let (chunks, remainder) = values.as_chunks::<3>();
assert!(chunks.remainder().is_empty()); assert!(remainder.is_empty());
chunks.map(|chunk| { chunks.iter().map(|chunk| {
// Slice accesses will not panic, guaranteed by `chunks_exact(3)`.
#[allow(clippy::indexing_slicing)]
Ok(PayloadUpsert { Ok(PayloadUpsert {
id: PayloadId::from_str(&chunk[0])?, id: PayloadId::from_str(&chunk[0])?,
key: chunk[1].to_owned(), key: chunk[1].to_owned(),
@@ -330,7 +328,7 @@ mod test {
} }
#[test] #[test]
#[should_panic(expected = "assertion failed: chunks.remainder().is_empty()")] #[should_panic(expected = "assertion failed: remainder.is_empty()")]
fn should_not_parse_into_payload() { fn should_not_parse_into_payload() {
let _: Result<Vec<_>, _> = let _: Result<Vec<_>, _> =
parse_many_upserts(&["xyz.radicle.project".to_string(), "name".to_string()]).collect(); parse_many_upserts(&["xyz.radicle.project".to_string(), "name".to_string()]).collect();
Generated
+3 -3
View File
@@ -139,11 +139,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1784697913, "lastModified": 1787993548,
"narHash": "sha256-DK+AmC9SQ9hmOFNIMu1l05gJtsmKyYsfJnuFtt1TnAU=", "narHash": "sha256-+IAEnmmx5YIhUWo0lp15jLLHchnXo5yKgWsi6C6Cf+0=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "47759faaddf38fadaf172151ca9df8adae9c0b2e", "rev": "996e9b0b019a4a9eb9e9a5641aefa06d801b5895",
"type": "github" "type": "github"
}, },
"original": { "original": {
+1 -1
View File
@@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "1.97.1" channel = "1.98.0"
profile = "default" profile = "default"
components = [ "rust-src" ] components = [ "rust-src" ]