From 55ef7733199976d383fd0c3cf874e242997ac067 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 17 Feb 2024 14:22:41 +0000 Subject: [PATCH] Fix clippy in tests --- pisshoff-server/src/command/cat.rs | 2 +- pisshoff-server/src/command/scp.rs | 2 +- pisshoff-server/src/subsystem/shell/parser.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pisshoff-server/src/command/cat.rs b/pisshoff-server/src/command/cat.rs index efd3d0b..dc258f8 100644 --- a/pisshoff-server/src/command/cat.rs +++ b/pisshoff-server/src/command/cat.rs @@ -79,7 +79,7 @@ impl Command for Cat { mod test { use std::path::Path; - use mockall::predicate::{self, always}; + use mockall::predicate::always; use crate::{ command::{cat::Cat, Command, CommandResult}, diff --git a/pisshoff-server/src/command/scp.rs b/pisshoff-server/src/command/scp.rs index 67eb7b6..745c10e 100644 --- a/pisshoff-server/src/command/scp.rs +++ b/pisshoff-server/src/command/scp.rs @@ -373,7 +373,7 @@ mod test { .unwrap_stdin(); insta::with_settings!({filters => vec![ - (r#"\bstart_offset: [^,]+"#, "start_offset: [stripped]") + (r"\bstart_offset: [^,]+", "start_offset: [stripped]") ]}, { assert_debug_snapshot!(state.audit_log()); }); diff --git a/pisshoff-server/src/subsystem/shell/parser.rs b/pisshoff-server/src/subsystem/shell/parser.rs index 6ff1b69..006fb5b 100644 --- a/pisshoff-server/src/subsystem/shell/parser.rs +++ b/pisshoff-server/src/subsystem/shell/parser.rs @@ -316,7 +316,7 @@ mod test { assert!(rest.is_empty()); let state = ConnectionState::mock(); - let mut command = Iter::new(s.into()); + let mut command = Iter::new(s); // once we step we should be requested to execute `echo hello` for subbing let step = command.step(state.environment(), None); @@ -346,7 +346,7 @@ mod test { assert!(rest.is_empty()); let state = ConnectionState::mock(); - let mut command = Iter::new(s.into()); + let mut command = Iter::new(s); // once we step we should be requested to execute `echo the whole` for subbing let step = command.step(state.environment(), None); @@ -504,7 +504,7 @@ mod test { ParsedPart::Break, ParsedPart::String(Cow::Borrowed(b"hello")), ]) - ) + ); } } @@ -557,7 +557,7 @@ mod test { ])), ParsedPart::String(Cow::Borrowed(b" test")), ] - ) + ); } #[test] -- libgit2 1.7.2