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,8 +4,8 @@ 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
|
||||||
# inability of the rustup action to install components, and the only component
|
# inability of the rustup action to install components, and the only component
|
||||||
|
|||||||
@@ -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)`.
|
name: chunk[0].to_string(),
|
||||||
#[allow(clippy::indexing_slicing)]
|
content: EmbedContent::from(T::from(chunk[1].clone())),
|
||||||
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<'_> {
|
) -> 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
@@ -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
@@ -1,4 +1,4 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.97.1"
|
channel = "1.98.0"
|
||||||
profile = "default"
|
profile = "default"
|
||||||
components = [ "rust-src" ]
|
components = [ "rust-src" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user