nushell/crates/nu-color-config/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
..
color_config.rs Construct Records only through checked helpers (#11386) 2023-12-21 16:48:15 +01:00
lib.rs color_config now accepts closures as color values (#7141) 2022-12-17 07:07:56 -06:00
matching_brackets_style.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
nu_style.rs Name the Value conversion functions more clearly (#11851) 2024-02-17 18:14:16 +00:00
shape_color.rs add shape ExternalResolved to show found externals via syntax highlighting in the repl (#11135) 2023-11-25 09:42:05 -06:00
style_computer.rs do not attempt to glob expand if the file path is wrapped in quotes (#11569) 2024-01-21 23:22:25 +08:00
text_style.rs Update nu-ansi-term, lscolors, and reedline (#9787) 2023-07-24 13:16:18 +02:00