nushell/crates/nu-command/src/path
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
..
basename.rs Add long options for path (#10775) 2023-10-19 22:07:01 +02:00
dirname.rs Add long options for path (#10775) 2023-10-19 22:07:01 +02:00
exists.rs check existance w/o traversing symlinks (#10872) 2024-01-14 07:33:33 +08:00
expand.rs Fix incorrect handling of boolean flags for builtin commands (#11492) 2024-01-11 17:19:48 +02:00
join.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
mod.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
parse.rs Convert more examples and tests to record! macro (#10840) 2023-10-28 14:52:31 +02:00
path_.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
relative_to.rs Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
split.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
type.rs Allow parse-time evaluation of calls, pipelines and subexpressions (#9499) 2023-08-26 16:41:29 +03:00