rewrite: removed unneeded operations

This commit is contained in:
iff 2023-08-06 11:20:43 +02:00
parent 10a23a7e09
commit 18f5627587

View file

@ -23,9 +23,8 @@ fn last_command(shell: &str) -> String {
let last_command = std::env::var("_PR_LAST_COMMAND").expect("No _PR_LAST_COMMAND in environment. Did you aliased the command with the correct argument?");
match shell {
"bash" => {
let first_line = last_command.lines().next().unwrap();
let split = first_line.split_whitespace().collect::<Vec<&str>>();
split[1..].join(" ")
let first_line = last_command.lines().next().unwrap().trim();
first_line.split_once(" ").unwrap().1.to_string()
}
"zsh" => last_command,
"fish" => last_command,