Various open improvements

This commit is contained in:
Jonathan Turner
2019-07-30 15:48:02 +12:00
parent 7b548026a2
commit 8ac70e7408
3 changed files with 61 additions and 46 deletions

View File

@@ -45,9 +45,9 @@ pub fn from_ini(args: CommandArgs) -> Result<OutputStream, ShellError> {
.map(move |a| match a.item {
Value::Primitive(Primitive::String(s)) => match from_ini_string_to_value(s, span) {
Ok(x) => ReturnSuccess::value(x.spanned(a.span)),
Err(e) => Err(ShellError::maybe_labeled_error(
Err(_) => Err(ShellError::maybe_labeled_error(
"Could not parse as INI",
format!("{:#?}", e),
"piped data failed INI parse",
span,
)),
},

View File

@@ -148,7 +148,10 @@ pub fn fetch(
}
(ty, sub_ty) => Ok((
None,
Value::string(format!("Not yet support MIME type: {} {}", ty, sub_ty)),
Value::string(format!(
"Not yet supported MIME type: {} {}",
ty, sub_ty
)),
Span::unknown_with_uuid(Uuid::new_v4()),
SpanSource::Url(r.url().to_string()),
)),