diff options
| author | Jonas Maier <> | 2026-03-10 17:53:01 +0100 |
|---|---|---|
| committer | Jonas Maier <> | 2026-03-10 17:53:01 +0100 |
| commit | ff3ac68d159869d57e2cc190236d08c64e00b867 (patch) | |
| tree | f234b4d5a7bf703fef4b2be46362ab8ff754824c /src/run/mod.rs | |
| parent | 872e334949421cc4c9ef86b037b91f34540a9ee2 (diff) | |
| download | pish-ff3ac68d159869d57e2cc190236d08c64e00b867.tar.gz | |
some clippy warnings
Diffstat (limited to 'src/run/mod.rs')
| -rw-r--r-- | src/run/mod.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/run/mod.rs b/src/run/mod.rs index c7f4408..6234b96 100644 --- a/src/run/mod.rs +++ b/src/run/mod.rs @@ -49,7 +49,7 @@ impl ExecError { e => format!("I am surprised you can get this error here: {e:?}"), }, ExecError::IO(error) => format!("{error:?}"), - ExecError::Panic => format!("worker thread panicked"), + ExecError::Panic => String::from("worker thread panicked"), ExecError::ErrorStack(stack) => { let mut out = String::new(); for e in stack.iter() { @@ -98,9 +98,9 @@ pub enum Output { File(File), } -impl Into<Stdio> for Input { - fn into(self) -> Stdio { - match self { +impl From<Input> for Stdio { + fn from(value: Input) -> Self { + match value { Input::Stdin => Stdio::inherit(), Input::Pipe(reader) => reader.into(), Input::File(file) => file.into(), @@ -108,9 +108,9 @@ impl Into<Stdio> for Input { } } -impl Into<Stdio> for Output { - fn into(self) -> Stdio { - match self { +impl From<Output> for Stdio { + fn from(value: Output) -> Stdio { + match value { Output::Stdout => Stdio::inherit(), Output::Pipe(writer) => writer.into(), Output::File(file) => file.into(), @@ -399,7 +399,7 @@ pub fn run(se: Arc<Mutex<Session>>, cmd: Vec<u8>) { Ok(p) => p, Err(err) => { se.lock().unwrap().raw.disable(); - println!("{:?}: {}", err.0, String::from_utf8_lossy(&err.1)); + println!("{:?}: {}", err.0, String::from_utf8_lossy(err.1)); print!("{}", se.lock().unwrap().prompt()); std::io::stdout().lock().flush().unwrap(); se.lock().unwrap().raw.enable(); |
