mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
CantConvert improvements (#4926)
* CantConvert improvements * cargo fmt
This commit is contained in:
@ -193,7 +193,7 @@ fn from_eml(
|
||||
.with_body_preview(body_preview)
|
||||
.parse()
|
||||
.map_err(|_| {
|
||||
ShellError::CantConvert("structured data from eml".into(), "string".into(), head)
|
||||
ShellError::CantConvert("structured eml data".into(), "string".into(), head)
|
||||
})?;
|
||||
|
||||
let mut collected = IndexMap::new();
|
||||
|
@ -135,7 +135,7 @@ fn convert_nujson_to_value(value: &nu_json::Value, span: Span) -> Value {
|
||||
Value::Error {
|
||||
error: ShellError::CantConvert(
|
||||
"i64 sized integer".into(),
|
||||
"larger than i64".into(),
|
||||
"value larger than i64".into(),
|
||||
span,
|
||||
),
|
||||
}
|
||||
@ -201,7 +201,7 @@ fn convert_string_to_value(string_input: String, span: Span) -> Result<Value, Sh
|
||||
))
|
||||
}
|
||||
x => Err(ShellError::CantConvert(
|
||||
format!("structured data from json ({})", x),
|
||||
format!("structured json data ({})", x),
|
||||
"string".into(),
|
||||
span,
|
||||
)),
|
||||
|
@ -121,7 +121,7 @@ pub fn convert_string_to_value(string_input: String, span: Span) -> Result<Value
|
||||
Ok(value) => Ok(convert_toml_to_value(&value, span)),
|
||||
|
||||
Err(_x) => Err(ShellError::CantConvert(
|
||||
"structured data from toml".into(),
|
||||
"structured toml data".into(),
|
||||
"string".into(),
|
||||
span,
|
||||
)),
|
||||
|
Reference in New Issue
Block a user