forked from extern/nushell
allow int and float as strings for arguments (#4615)
* allow int and float as strings for arguments * consume iterator
This commit is contained in:
@ -173,6 +173,8 @@ impl Clone for Value {
|
||||
impl Value {
|
||||
pub fn as_string(&self) -> Result<String, ShellError> {
|
||||
match self {
|
||||
Value::Int { val, .. } => Ok(val.to_string()),
|
||||
Value::Float { val, .. } => Ok(val.to_string()),
|
||||
Value::String { val, .. } => Ok(val.to_string()),
|
||||
Value::Binary { val, .. } => Ok(match std::str::from_utf8(val) {
|
||||
Ok(s) => s.to_string(),
|
||||
|
Reference in New Issue
Block a user