nushell/crates/nu-color-config/src
Stefan Holderbach 406df7f208
Avoid taking unnecessary ownership of intermediates (#12740)
# Description

Judiciously try to avoid allocations/clone by changing the signature of
functions

- **Don't pass str by value unnecessarily if only read**
- **Don't require a vec in `Sandbox::with_files`**
- **Remove unnecessary string clone**
- **Fixup unnecessary borrow**
- **Use `&str` in shape color instead**
- **Vec -> Slice**
- **Elide string clone**
- **Elide `Path` clone**
- **Take &str to elide clone in tests**

# User-Facing Changes
None

# Tests + Formatting
This touches many tests purely in changing from owned to borrowed/static
data
2024-05-04 00:53:15 +00:00
..
color_config.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00: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 Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
style_computer.rs Remove lazy records (#12682) 2024-05-03 08:36:10 +08:00
text_style.rs Update nu-ansi-term, lscolors, and reedline (#9787) 2023-07-24 13:16:18 +02:00