From ff63ae66554e6047661e8e3d952e06ebdfb24a5a Mon Sep 17 00:00:00 2001 From: jokemanfire Date: Wed, 31 Dec 2025 15:31:37 +0800 Subject: [PATCH] build(deps): update the rust version for adopt edition 2024 --- Cargo.toml | 2 +- crates/runc-shim/src/processes.rs | 2 +- crates/runc-shim/src/task.rs | 2 +- crates/shim/src/asynchronous/publisher.rs | 2 +- crates/shim/src/mount_linux.rs | 4 ++-- crates/snapshots/src/lib.rs | 4 ++-- rust-toolchain.toml | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c3a959b8..a9158b17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ edition = "2021" # Common dependencies for all crates [workspace.dependencies] -async-trait = "0.1.52" +async-trait = "0.1.89" cgroups-rs = "0.4.0" crossbeam = "0.8.1" futures = "0.3.19" diff --git a/crates/runc-shim/src/processes.rs b/crates/runc-shim/src/processes.rs index 42d4d185..0cf060ee 100644 --- a/crates/runc-shim/src/processes.rs +++ b/crates/runc-shim/src/processes.rs @@ -56,7 +56,7 @@ pub trait Process { async fn resume(&mut self) -> Result<()>; async fn id(&self) -> &str; } - +#[allow(dead_code)] #[async_trait] pub trait ProcessLifecycle { async fn start(&self, p: &mut P) -> Result<()>; diff --git a/crates/runc-shim/src/task.rs b/crates/runc-shim/src/task.rs index f14c0f36..d5f74e83 100644 --- a/crates/runc-shim/src/task.rs +++ b/crates/runc-shim/src/task.rs @@ -474,7 +474,7 @@ where async fn shutdown(&self, _ctx: &TtrpcContext, _req: ShutdownRequest) -> TtrpcResult { debug!("Shutdown request"); let containers = self.containers.read().await; - if containers.len() > 0 { + if !containers.is_empty() { return Ok(Empty::new()); } self.exit.signal(); diff --git a/crates/shim/src/asynchronous/publisher.rs b/crates/shim/src/asynchronous/publisher.rs index 16a4d145..e1a72dcf 100644 --- a/crates/shim/src/asynchronous/publisher.rs +++ b/crates/shim/src/asynchronous/publisher.rs @@ -36,7 +36,7 @@ use crate::{ /// The publisher reports events and uses a queue to retry the event reporting. /// The maximum number of attempts to report is 5 times. /// When the ttrpc client fails to report, it attempts to reconnect to the client and report. - +/// /// Max queue size const QUEUE_SIZE: i64 = 1024; /// Max try five times diff --git a/crates/shim/src/mount_linux.rs b/crates/shim/src/mount_linux.rs index a6c86b4d..09983c77 100644 --- a/crates/shim/src/mount_linux.rs +++ b/crates/shim/src/mount_linux.rs @@ -791,12 +791,12 @@ pub fn setup_loop_dev(backing_file: &str, loop_dev: &str, params: &LoopParams) - } // 3. set info let mut info = LoopInfo::default(); - let backing_file_truncated = if backing_file.as_bytes().len() > info.file_name.len() { + let backing_file_truncated = if backing_file.len() > info.file_name.len() { &backing_file[0..info.file_name.len()] } else { backing_file }; - info.file_name[..backing_file_truncated.as_bytes().len()] + info.file_name[..backing_file_truncated.len()] .copy_from_slice(backing_file_truncated.as_bytes()); if params.readonly { info.flags |= LO_FLAGS_READ_ONLY; diff --git a/crates/snapshots/src/lib.rs b/crates/snapshots/src/lib.rs index c6965127..718ee852 100644 --- a/crates/snapshots/src/lib.rs +++ b/crates/snapshots/src/lib.rs @@ -32,8 +32,8 @@ pub use wrap::server; /// Generated GRPC apis. pub mod api { - #[allow(clippy::tabs_in_doc_comments)] - #[allow(rustdoc::invalid_rust_codeblocks)] + #![allow(clippy::tabs_in_doc_comments)] + #![allow(rustdoc::invalid_rust_codeblocks)] /// Generated snapshots bindings. pub mod snapshots { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2b65da68..54e5b5ec 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.82" +channel = "1.91" components = ["rustfmt", "clippy", "llvm-tools"]