Rust

Rust

By DeepSource

Found occurrence of Box<Vec<T>> RS-W1061

Anti-pattern

Box<Vec<T>> is unnecessary, consider using Box<[T]> or Vec<T>. Vecs are already stored on the heap, boxing them simply adds another level of indirection. Consider using Box<[T]> or Vec<T> instead.

Examples

Bad practice

struct Foo<T> {
    bar: Box<Vec<T>>
}

Recommended

struct Foo<T> {
    bar: Vec<T>
}