mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Convert Shellerror::GenericError
to named fields (#11230)
# Description Replace `.to_string()` used in `GenericError` with `.into()` as `.into()` seems more popular Replace `Vec::new()` used in `GenericError` with `vec![]` as `vec![]` seems more popular (There are so, so many)
This commit is contained in:
@ -601,16 +601,16 @@ impl ExternalCommand {
|
||||
}
|
||||
process
|
||||
} else {
|
||||
return Err(ShellError::GenericError(
|
||||
"Current directory not found".to_string(),
|
||||
"did not find PWD environment variable".to_string(),
|
||||
Some(span),
|
||||
Some(concat!(
|
||||
return Err(ShellError::GenericError{
|
||||
error: "Current directory not found".into(),
|
||||
msg: "did not find PWD environment variable".into(),
|
||||
span: Some(span),
|
||||
help: Some(concat!(
|
||||
"The environment variable 'PWD' was not found. ",
|
||||
"It is required to define the current directory when running an external command."
|
||||
).to_string()),
|
||||
Vec::new(),
|
||||
));
|
||||
).into()),
|
||||
inner:Vec::new(),
|
||||
});
|
||||
};
|
||||
|
||||
process.envs(&self.env_vars);
|
||||
|
Reference in New Issue
Block a user