Skip to content

GEN-203: Report could use ThinVec<Frame> instead of Box<Vec<Frame>> #5408

@GnomedDev

Description

@GnomedDev

Related Problem

Box<Vec<Frame>> is double indirection, but is being used here to minimize the inline size so the box_collection clippy lint is being silenced.

Source:

pub(super) frames: Box<Vec<Frame>>,

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

Metadata

Metadata

Labels

area/dxImprovements or additions to DX or docsarea/libsRelates to first-party libraries/crates/packages (area)area/libs > error-stackAffects the `error-stack` crate (library)category/enhancementNew feature or requestlang/rustPull requests that update Rust codepriority/3 lowLower priority: nice-to-have

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions