mirror of
https://github.com/nushell/nushell.git
synced 2025-01-23 14:50:09 +01:00
17abbdf6e0
related to - https://discord.com/channels/601130461678272522/615329862395101194/1149717458786197524 # Description because `1_234 | into datetime` takes an integer number of `ns` and `1_234 | into filesize` takes an integer amount of bytes, i think `1_234 | into duration` should also be valid and see `1_234` as an integer amount of `ns` 😋 # User-Facing Changes ## before either ```nushell 1234 | into string | $in ++ "ns" | into duration ``` ```nushell 1234 | $"($in)ns" | into duration ``` or ```nushell 1234 * 1ns ``` and ```nushell > 1_234 | into duration Error: nu::parser::input_type_mismatch × Command does not support int input. ╭─[entry #2:1:1] 1 │ 1_234 | into duration · ──────┬────── · ╰── command doesn't support int input ╰──── ``` ## after ```nushell > 1_234 | into duration 1µs 234ns ``` # Tests + Formatting new example test ```rust Example { description: "Convert a number of ns to duration", example: "1_234_567 | into duration", result: Some(Value::duration(1_234_567, span)), } ``` # After Submitting |
||
---|---|---|
.. | ||
bytes | ||
charting | ||
conversions | ||
database | ||
date | ||
debug | ||
env | ||
experimental | ||
filesystem | ||
filters | ||
formats | ||
generators | ||
hash | ||
help | ||
math | ||
misc | ||
network | ||
path | ||
platform | ||
random | ||
removed | ||
shells | ||
strings | ||
system | ||
viewers | ||
default_context.rs | ||
example_test.rs | ||
lib.rs | ||
progress_bar.rs | ||
sort_utils.rs |