mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-18 19:10:30 +08:00
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:
@@ -4,7 +4,7 @@ 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
|
||||
|
||||
@@ -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())),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -49,13 +49,11 @@ pub(super) fn parse_many_upserts(
|
||||
) -> impl Iterator<Item = Result<PayloadUpsert, PayloadUpsertParseError>> + 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<Vec<_>, _> =
|
||||
parse_many_upserts(&["xyz.radicle.project".to_string(), "name".to_string()]).collect();
|
||||
|
||||
Generated
+3
-3
@@ -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": {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
[toolchain]
|
||||
channel = "1.97.1"
|
||||
channel = "1.98.0"
|
||||
profile = "default"
|
||||
components = [ "rust-src" ]
|
||||
|
||||
Reference in New Issue
Block a user