mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 02:00:22 +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:
@ -157,15 +157,15 @@ fn expand(path: &Path, span: Span, args: &Arguments) -> Value {
|
||||
}
|
||||
}
|
||||
Err(_) => Value::error(
|
||||
ShellError::GenericError(
|
||||
"Could not expand path".into(),
|
||||
"could not be expanded (path might not exist, non-final \
|
||||
ShellError::GenericError {
|
||||
error: "Could not expand path".into(),
|
||||
msg: "could not be expanded (path might not exist, non-final \
|
||||
component is not a directory, or other cause)"
|
||||
.into(),
|
||||
Some(span),
|
||||
None,
|
||||
Vec::new(),
|
||||
),
|
||||
span: Some(span),
|
||||
help: None,
|
||||
inner: vec![],
|
||||
},
|
||||
span,
|
||||
),
|
||||
}
|
||||
|
Reference in New Issue
Block a user