Remove some unnecessary static Vecs (#11947)

Avoid unnecessary allocations or larger iterator structs

- Turn static `Vec`s into arrays when possible
- Use `std::iter::once`/`empty` where applicable
- Use `bool::then_some` in `detect column` `.chain`
- Drop in the bucket: de-vec-ing tests
This commit is contained in:
Stefan Holderbach
2024-02-24 20:58:01 +01:00
committed by GitHub
parent 098527b263
commit 7884de1941
10 changed files with 115 additions and 113 deletions

View File

@ -550,7 +550,7 @@ fn eval_element_with_input(
// so nushell knows this result is not the last part of a command.
(
Some(RawStream::new(
Box::new(vec![].into_iter()),
Box::new(std::iter::empty()),
None,
*span,
Some(0),