nushell/crates/nu-command/src/strings/split
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
..
chars.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
column.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
command.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
list.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
mod.rs Fix internal module reexports (#9378) 2023-06-07 16:36:34 +02:00
row.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
words.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00