nushell/crates/nu-explore/src
Ian Manske 68fcd71898
Add Value::coerce_str (#11885)
# Description
Following #11851, this PR adds one final conversion function for
`Value`. `Value::coerce_str` takes a `&Value` and converts it to a
`Cow<str>`, creating an owned `String` for types that needed converting.
Otherwise, it returns a borrowed `str` for `String` and `Binary`
`Value`s which avoids a clone/allocation. Where possible, `coerce_str`
and `coerce_into_string` should be used instead of `coerce_string`,
since `coerce_string` always allocates a new `String`.
2024-02-18 17:47:10 +01:00
..
commands Remove Record::from_raw_cols_vals_unchecked (#11810) 2024-02-18 14:20:22 +02:00
nu_common Convert more ShellError variants to named fields (#11173) 2023-11-28 06:43:51 -06:00
pager Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
registry explore: remove :config, :show-config, :tweak commands (#10259) 2023-09-07 10:34:08 -05:00
views Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
default_context.rs Move explore command out of nu-command deps (#9421) 2023-06-14 01:18:36 +02:00
explore.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
lib.rs Name the Value conversion functions more clearly (#11851) 2024-02-17 18:14:16 +00:00