From db88ac6fd842a7031c6daedf232d61e3413bb80e Mon Sep 17 00:00:00 2001 From: Furisto <24721048+Furisto@users.noreply.github.com> Date: Sat, 30 Jul 2022 13:29:59 +0200 Subject: [PATCH] Fix clippy lints Signed-off-by: Furisto <24721048+Furisto@users.noreply.github.com> --- crates/youki/src/commands/list.rs | 8 +++++--- .../integration_test/src/tests/cgroups/cpu/mod.rs | 1 + .../integration_test/src/tests/hooks/invoke.rs | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/youki/src/commands/list.rs b/crates/youki/src/commands/list.rs index 548a0d82d..c2906941e 100644 --- a/crates/youki/src/commands/list.rs +++ b/crates/youki/src/commands/list.rs @@ -1,4 +1,5 @@ //! Contains Functionality of list container command +use std::fmt::Write as _; use std::fs; use std::io; use std::io::Write; @@ -40,15 +41,16 @@ pub fn list(_: List, root_path: PathBuf) -> Result<()> { "".to_owned() }; - content.push_str(&format!( - "{}\t{}\t{}\t{}\t{}\t{}\n", + let _ = writeln!( + content, + "{}\t{}\t{}\t{}\t{}\t{}", container.id(), pid, container.status(), container.bundle().display(), created, user_name.to_string_lossy() - )); + ); } let mut tab_writer = TabWriter::new(io::stdout()); diff --git a/tests/rust-integration-tests/integration_test/src/tests/cgroups/cpu/mod.rs b/tests/rust-integration-tests/integration_test/src/tests/cgroups/cpu/mod.rs index 8e607b28f..3cc78a0b6 100644 --- a/tests/rust-integration-tests/integration_test/src/tests/cgroups/cpu/mod.rs +++ b/tests/rust-integration-tests/integration_test/src/tests/cgroups/cpu/mod.rs @@ -8,6 +8,7 @@ use oci_spec::runtime::{ pub mod v1; pub mod v2; +#[allow(clippy::too_many_arguments)] fn create_cpu_spec( shares: u64, quota: i64, diff --git a/tests/rust-integration-tests/integration_test/src/tests/hooks/invoke.rs b/tests/rust-integration-tests/integration_test/src/tests/hooks/invoke.rs index 68f436fc8..19de49c02 100644 --- a/tests/rust-integration-tests/integration_test/src/tests/hooks/invoke.rs +++ b/tests/rust-integration-tests/integration_test/src/tests/hooks/invoke.rs @@ -83,7 +83,7 @@ fn get_test<'a>(test_name: &'static str) -> Test<'a> { log }; delete_hook_output_file(); - if log != "pre-start1 called\npre-start2 called\npost-start1 called\npost-start2 called\npost-stop1 called\npost-stop2 called\n".to_string() { + if log != "pre-start1 called\npre-start2 called\npost-start1 called\npost-start2 called\npost-stop1 called\npost-stop2 called\n" { return TestResult::Failed(anyhow!( "error : hooks must be called in the listed order" ));