From de43682f16ce19c48744799ea8425f16eabaaefa Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Sat, 29 Aug 2026 22:56:18 +0200 Subject: [PATCH] =?UTF-8?q?rust:=201.97.1=20=E2=86=92=201.98.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .radicle/ambient.yaml | 4 ++-- crates/radicle-cli/src/commands/cob/args.rs | 14 +++++--------- crates/radicle-cli/src/commands/id/args.rs | 10 ++++------ flake.lock | 6 +++--- rust-toolchain.toml | 2 +- 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.radicle/ambient.yaml b/.radicle/ambient.yaml index e0e82ac2a..54c4d2697 100644 --- a/.radicle/ambient.yaml +++ b/.radicle/ambient.yaml @@ -4,8 +4,8 @@ pre_plan: # This channel is also defined in `rust-toolchain.toml` – which hopefully can # be supported by ambient in the future. - action: rustup - channel: 1.97.1 - + channel: 1.98.0 + plan: # Remove the components from rust-toolchain.toml. This works around the # inability of the rustup action to install components, and the only component diff --git a/crates/radicle-cli/src/commands/cob/args.rs b/crates/radicle-cli/src/commands/cob/args.rs index 704bc74fb..f0218a442 100644 --- a/crates/radicle-cli/src/commands/cob/args.rs +++ b/crates/radicle-cli/src/commands/cob/args.rs @@ -204,17 +204,13 @@ where { // `clap` ensures we have 2 values per option occurrence, // 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| { - // Slice accesses will not panic, guaranteed by `chunks_exact(2)`. - #[allow(clippy::indexing_slicing)] - Embed { - name: chunk[0].to_string(), - content: EmbedContent::from(T::from(chunk[1].clone())), - } + chunks.iter().map(|chunk| Embed { + name: chunk[0].to_string(), + content: EmbedContent::from(T::from(chunk[1].clone())), }) } diff --git a/crates/radicle-cli/src/commands/id/args.rs b/crates/radicle-cli/src/commands/id/args.rs index 5b248b8da..038a1e625 100644 --- a/crates/radicle-cli/src/commands/id/args.rs +++ b/crates/radicle-cli/src/commands/id/args.rs @@ -49,13 +49,11 @@ pub(super) fn parse_many_upserts( ) -> impl Iterator> + use<'_> { // `clap` ensures we have 3 values per option occurrence, // 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| { - // Slice accesses will not panic, guaranteed by `chunks_exact(3)`. - #[allow(clippy::indexing_slicing)] + chunks.iter().map(|chunk| { Ok(PayloadUpsert { id: PayloadId::from_str(&chunk[0])?, key: chunk[1].to_owned(), @@ -330,7 +328,7 @@ mod 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() { let _: Result, _> = parse_many_upserts(&["xyz.radicle.project".to_string(), "name".to_string()]).collect(); diff --git a/flake.lock b/flake.lock index 85f528016..147e61e08 100644 --- a/flake.lock +++ b/flake.lock @@ -139,11 +139,11 @@ ] }, "locked": { - "lastModified": 1784697913, - "narHash": "sha256-DK+AmC9SQ9hmOFNIMu1l05gJtsmKyYsfJnuFtt1TnAU=", + "lastModified": 1787993548, + "narHash": "sha256-+IAEnmmx5YIhUWo0lp15jLLHchnXo5yKgWsi6C6Cf+0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "47759faaddf38fadaf172151ca9df8adae9c0b2e", + "rev": "996e9b0b019a4a9eb9e9a5641aefa06d801b5895", "type": "github" }, "original": { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b8b33a0a0..b56c9cfdd 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.97.1" +channel = "1.98.0" profile = "default" components = [ "rust-src" ]