nushell/crates/nu-test-support/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
..
playground Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
commands.rs Fix unit tests on Android (#10224) 2023-09-05 20:17:34 +12:00
fs.rs fix clippy (#10659) 2023-10-10 03:31:15 +13:00
lib.rs Allow spreading arguments to commands (#11289) 2023-12-28 15:43:20 +08:00
locale_override.rs Remove once_cell dependency from nu-test-support create. (#8568) 2023-03-22 19:36:52 +01:00
macros.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
playground.rs Update tests Playground (#12134) 2024-03-08 20:31:21 -08:00