mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
7fb639ffc1
Swap Subtree::token_trees from Vec to boxed slice Performs one of the optimizations suggested in #16325, but a little bit more. Boxed slices guarantee `shrink_to_fit` aswell as saving a pointer width as no capacity has to be stored. Most of the diff is: - Changing `vec![]` to `Box::new([])` - Changing initialize -> fill into fill -> into_boxed_slice - Working around the lack of an owned iterator or automatic iteration over a `Box<[T]>` I would like to use my own crate, [small-fixed-array](https://lib.rs/small-fixed-array), although I understand if it isn't mature enough for this. If I'm given the go ahead, I can rework this PR to use it instead. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |