mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
7f61cbbfd6
# Description Adds a new `Filesize` type so that `FromValue` can be used to convert a `Value::Filesize` to a `Filesize`. Currently, to extract a filesize from a `Value` using `FromValue`, you have to extract an `i64` which coerces `Value::Int`, `Value::Duration`, and `Value::Filesize` to an `i64`. Having a separate type also allows us to enforce checked math to catch overflows. Similarly, it allows us to specify other trait implementations like `Display` in a common place. # User-Facing Changes Multiplication with filesizes now error on overflow. Should not be a breaking change for plugins (i.e., serialization) since `Filesize` is marked with `serde(transparent)`. # Tests + Formatting Updated some tests. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE | ||
README.md |
Support for the NUON format.
The NUON format is a superset of JSON designed to fit the feel of Nushell. Some of its extra features are
- trailing commas are allowed
- commas are optional in lists
- quotes are not required around keys or any bare string that do not contain spaces or special characters
- comments are allowed, though not preserved when using [
from_nuon
]
Example
below is some data in the JSON format
{
"name": "Some One",
"birth": "1970-01-01",
"stats": [
2544729499973429198,
687051042647753531,
6702443901704799912
]
}
and an equivalent piece of data written in NUON
{
name: "Some One", # the name of the person
birth: "1970-01-01", # their date of birth
stats: [ # some dummy "stats" about them
2544729499973429198,
687051042647753531,
6702443901704799912, # note the trailing comma here...
], # and here
} # wait, are these comments in a JSON-like document?!?!