nushell/crates/nu_plugin_query/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
..
nu query web --query should return list<list<string>> like the scraper crate's ElementRef::text() (#11705) 2024-02-02 19:40:47 -06:00
lib.rs query command with json, web, xml (#870) 2022-02-01 12:45:48 -06:00
main.rs Bump to 0.60 (#4892) 2022-03-23 07:32:03 +13:00
query_json.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
query_web.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
query_xml.rs Add Value::coerce_str (#11885) 2024-02-18 17:47:10 +01:00
query.rs Add themes to help command when available #10318 (#10623) 2023-10-10 07:40:05 -05:00
web_tables.rs update query web wiki example (#11709) 2024-02-02 09:03:28 -06:00