filesize conversion (#5770)

This commit is contained in:
Fernando Herrera
2022-06-13 14:44:32 -05:00
committed by GitHub
parent 44979f3051
commit de554f8e5f
2 changed files with 17 additions and 15 deletions

View File

@ -16,6 +16,8 @@ impl Value {
pub fn as_i64(&self) -> Result<i64, ShellError> {
match self {
Value::Int { val, .. } => Ok(*val),
Value::Filesize { val, .. } => Ok(*val),
Value::Duration { val, .. } => Ok(*val),
x => Err(ShellError::CantConvert(
"i64".into(),
x.get_type().to_string(),