GEN-203: Report
could use ThinVec<Frame>
instead of Box<Vec<Frame>>
#5408
Labels
area/libs > error-stack
Affects the `error-stack` crate (library)
area/libs
Relates to first-party libraries/crates/packages (area)
category/enhancement
New feature or request
lang/rust
Pull requests that update Rust code
Related Problem
Box<Vec<Frame>>
is double indirection, but is being used here to minimize the inline size so thebox_collection
clippy lint is being silenced.Source:
hash/libs/error-stack/src/report.rs
Line 251 in 958822e
Proposed Solution
The ThinVec crate can be used to remove the double indirection while keeping the single inline pointer size by storing the capacity and length at the start of the allocation.
This crate is trusted by
rustc
, so shouldn't have any issues with trusting a new dependency.Alternatives
Keep as-is which will continue the double indirection, although on the cold path.
Additional context
No response
The text was updated successfully, but these errors were encountered: