nushell/crates
Antoine Stevan 17abbdf6e0
allow into duration to take an integer amount of ns (#10286)
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
2023-09-09 13:49:08 -05:00
..
nu_plugin_custom_values Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu_plugin_example Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu_plugin_formats Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu_plugin_gstat Bump git2 from 0.17.2 to 0.18.0 (#10207) 2023-09-04 21:10:25 +00:00
nu_plugin_inc Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu_plugin_python remove vectorize_over_list from python plugin (#9905) 2023-08-03 16:46:48 +02:00
nu_plugin_query Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu-cli Make cursor_shape optional (#10289) 2023-09-09 13:42:36 -05:00
nu-cmd-base Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu-cmd-dataframe Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu-cmd-extra move math constants to standard library (#9678) 2023-09-05 19:32:31 +02:00
nu-cmd-lang Bump itertools from 0.10.5 to 0.11.0 (#9524) 2023-09-08 23:12:45 +00:00
nu-color-config rename the types with spaces in them to use - (#9929) 2023-09-06 13:22:12 -05:00
nu-command allow into duration to take an integer amount of ns (#10286) 2023-09-09 13:49:08 -05:00
nu-engine rename the types with spaces in them to use - (#9929) 2023-09-06 13:22:12 -05:00
nu-explore Start removing colour config from explore (#10270) 2023-09-08 07:34:47 -07:00
nu-glob bump nushell to dev version 0.84.1 (#10101) 2023-08-23 15:23:27 -05:00
nu-json bump nushell to dev version 0.84.1 (#10101) 2023-08-23 15:23:27 -05:00
nu-parser Bump itertools from 0.10.5 to 0.11.0 (#9524) 2023-09-08 23:12:45 +00:00
nu-path Support Termux (#10013) 2023-08-28 09:53:25 +03:00
nu-plugin Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu-pretty-hex Remove Cargo.lock in subcrates (#10280) 2023-09-09 00:45:43 +02:00
nu-protocol Make cursor_shape optional (#10289) 2023-09-09 13:42:36 -05:00
nu-std change LOG_FORMAT to NU_LOG_FORMAT in nu-std library (#10254) 2023-09-06 10:17:14 -07:00
nu-system Remove Cargo.lock in subcrates (#10280) 2023-09-09 00:45:43 +02:00
nu-table add 6 more table themes (#10279) 2023-09-08 16:34:36 -05:00
nu-term-grid bump nushell to dev version 0.84.1 (#10101) 2023-08-23 15:23:27 -05:00
nu-test-support Fix unit tests on Android (#10224) 2023-09-05 20:17:34 +12:00
nu-utils Make cursor_shape optional (#10289) 2023-09-09 13:42:36 -05:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.