mirror of
https://github.com/nushell/nushell.git
synced 2025-04-25 05:38:20 +02:00
Use join over custom join code (#4548)
This commit is contained in:
parent
3f14b75153
commit
28b5399fb7
@ -194,17 +194,7 @@ impl ProcessInfo {
|
|||||||
pub fn command(&self) -> String {
|
pub fn command(&self) -> String {
|
||||||
if let Ok(cmd) = &self.curr_proc.cmdline() {
|
if let Ok(cmd) = &self.curr_proc.cmdline() {
|
||||||
if !cmd.is_empty() {
|
if !cmd.is_empty() {
|
||||||
let mut cmd = cmd
|
cmd.join(" ").replace("\n", " ").replace("\t", " ")
|
||||||
.iter()
|
|
||||||
.cloned()
|
|
||||||
.map(|mut x| {
|
|
||||||
x.push(' ');
|
|
||||||
x
|
|
||||||
})
|
|
||||||
.collect::<String>();
|
|
||||||
cmd.pop();
|
|
||||||
cmd = cmd.replace("\n", " ").replace("\t", " ");
|
|
||||||
cmd
|
|
||||||
} else {
|
} else {
|
||||||
self.curr_proc.stat().comm.clone()
|
self.curr_proc.stat().comm.clone()
|
||||||
}
|
}
|
||||||
|
@ -316,18 +316,7 @@ impl ProcessInfo {
|
|||||||
pub fn command(&self) -> String {
|
pub fn command(&self) -> String {
|
||||||
if let Some(path) = &self.curr_path {
|
if let Some(path) = &self.curr_path {
|
||||||
if !path.cmd.is_empty() {
|
if !path.cmd.is_empty() {
|
||||||
let mut cmd = path
|
path.cmd.join(" ").replace("\n", " ").replace("\t", " ")
|
||||||
.cmd
|
|
||||||
.iter()
|
|
||||||
.cloned()
|
|
||||||
.map(|mut x| {
|
|
||||||
x.push(' ');
|
|
||||||
x
|
|
||||||
})
|
|
||||||
.collect::<String>();
|
|
||||||
cmd.pop();
|
|
||||||
cmd = cmd.replace("\n", " ").replace("\t", " ");
|
|
||||||
cmd
|
|
||||||
} else {
|
} else {
|
||||||
String::from("")
|
String::from("")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user