error message cleanup for into string (#3488)

This commit is contained in:
Darren Schroeder 2021-05-25 07:49:12 -05:00 committed by GitHub
parent 5fcc7f2328
commit ac38ee82f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,20 +142,20 @@ pub fn action(
} }
Primitive::Nothing => "nothing".to_string(), Primitive::Nothing => "nothing".to_string(),
_ => { _ => {
return Err(ShellError::unimplemented( return Err(ShellError::unimplemented(&format!(
"str from for non-numeric primitives", "into string for primitive: {:?}",
)) prim
)))
} }
}) })
.into_value(tag)), .into_value(tag)),
UntaggedValue::Row(_) => Err(ShellError::labeled_error( UntaggedValue::Row(_) => Err(ShellError::labeled_error(
"specify column to use 'str from'", "specify column to use 'into string'",
"found table", "found table",
input.tag.clone(), input.tag.clone(),
)), )),
_ => Err(ShellError::unimplemented( UntaggedValue::Table(_) => Err(ShellError::unimplemented("into string for table")),
"str from for non-primitive, non-table types", _ => Err(ShellError::unimplemented("into string for non-primitive")),
)),
} }
} }