Browse Source

refactoring: fix clippy warnings in interpret function

main
fdai7375 2 years ago
parent
commit
2822f976c7
  1. 6
      src/execute.rs

6
src/execute.rs

@ -10,16 +10,16 @@ use std::{io, thread};
/// This function is not directly in main.rs because it might be called by other function too (eg.
/// when piping commands).
pub fn interpret(line: String, config: &mut BuiltinConfig, ctrlc_recv: Receiver<()>) {
match try_interpret(line, config, ctrlc_recv.clone()) {
match try_interpret(line, config, ctrlc_recv) {
Ok(_) | Err(ShellError::Interrupt) | Err(ShellError::EmptyLine) => (),
Err(ShellError::NotFound(cmd)) => {
eprintln!("{}: command not found", cmd.get_program().to_string_lossy())
}
Err(ShellError::ExecuteFailure(msg)) => {
eprintln!("{}", msg)
eprintln!("{msg}")
}
Err(ShellError::MalformedArgs(args)) => {
eprintln!("Malformed arguments: {}", args)
eprintln!("Malformed arguments: {args}")
}
}
}

Loading…
Cancel
Save