Merge branch 'nushell:main' into main

This commit is contained in:
Justin
2021-10-12 14:56:45 -07:00
committed by GitHub
3 changed files with 10 additions and 2 deletions

View File

@ -160,8 +160,8 @@ pub fn action(input: Value, span: Span) -> Value {
}
}
fn int_from_string(a_string: &str, span: Span) -> Result<i64, ShellError> {
match a_string.parse::<i64>() {
Ok(n) => Ok(n),
match a_string.parse::<bytesize::ByteSize>() {
Ok(n) => Ok(n.0 as i64),
Err(_) => Err(ShellError::CantConvert("int".into(), span)),
}
}