nushell/crates/nu-command/tests/format_conversions
Ian Manske 7f61cbbfd6
Add Filesize type (#14369)
# 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.
2024-11-29 21:24:17 +00:00
..
csv.rs truly flexible csv/tsv parsing (#14399) 2024-11-21 15:58:31 -06:00
html.rs Remove feat extra and include in default (#12140) 2024-03-10 17:29:02 +01:00
json.rs Make from json --objects streaming (#12949) 2024-05-24 23:37:50 +00:00
markdown.rs Clean up tests containing unnecessary cwd: tokens (#9692) 2023-07-17 18:43:51 +02:00
mod.rs Msgpack commands (#12664) 2024-04-26 06:23:16 -05:00
msgpack.rs Msgpack commands (#12664) 2024-04-26 06:23:16 -05:00
msgpackz.rs Msgpack commands (#12664) 2024-04-26 06:23:16 -05:00
nuon.rs Add Filesize type (#14369) 2024-11-29 21:24:17 +00:00
ods.rs Bump Calamine (#14403) 2024-11-21 20:31:14 +08:00
ssv.rs Make the subcommands (from {csv, tsv, ssv}) 0-based for consistency (#13209) 2024-06-26 17:51:47 -05:00
toml.rs Clean up tests containing unnecessary cwd: tokens (#9692) 2023-07-17 18:43:51 +02:00
tsv.rs Make the subcommands (from {csv, tsv, ssv}) 0-based for consistency (#13209) 2024-06-26 17:51:47 -05:00
url.rs Rename to url command to url build-query (#7702) 2023-01-15 10:16:29 -08:00
xlsx.rs Add date support in from xlsx (#11952) 2024-02-24 07:25:51 -06:00
xml.rs Add self-closed tag support for to xml (#11577) 2024-01-19 05:35:29 -06:00
yaml.rs Clean up tests containing unnecessary cwd: tokens (#9692) 2023-07-17 18:43:51 +02:00