mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Use join over custom join code (#4548)
This commit is contained in:
@ -316,18 +316,7 @@ impl ProcessInfo {
|
||||
pub fn command(&self) -> String {
|
||||
if let Some(path) = &self.curr_path {
|
||||
if !path.cmd.is_empty() {
|
||||
let mut cmd = path
|
||||
.cmd
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|mut x| {
|
||||
x.push(' ');
|
||||
x
|
||||
})
|
||||
.collect::<String>();
|
||||
cmd.pop();
|
||||
cmd = cmd.replace("\n", " ").replace("\t", " ");
|
||||
cmd
|
||||
path.cmd.join(" ").replace("\n", " ").replace("\t", " ")
|
||||
} else {
|
||||
String::from("")
|
||||
}
|
||||
|
Reference in New Issue
Block a user