mirror of
https://github.com/nushell/nushell
synced 2024-12-28 22:13:10 +00:00
Merge branch 'nushell:main' into main
This commit is contained in:
commit
f5ce63ad55
3 changed files with 10 additions and 2 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -113,6 +113,12 @@ dependencies = [
|
|||
"utf8-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bytesize"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.71"
|
||||
|
@ -533,6 +539,7 @@ dependencies = [
|
|||
name = "nu-command"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytesize",
|
||||
"chrono",
|
||||
"glob",
|
||||
"lscolors",
|
||||
|
|
|
@ -24,6 +24,7 @@ sysinfo = "0.20.4"
|
|||
chrono = { version = "0.4.19", features = ["serde"] }
|
||||
terminal_size = "0.1.17"
|
||||
lscolors = { version = "0.8.0", features = ["crossterm"] }
|
||||
bytesize = "1.1.0"
|
||||
|
||||
[features]
|
||||
trash-support = ["trash"]
|
||||
|
|
|
@ -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)),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue