Rust

Rust

By DeepSource

Found occurrence of `Arc<Box<T>>`RS-W1057

Anti-pattern

Arc<Box<T>> is redundant. Arc<T> allows T to be an unsized type, boxing it simply adds another level of indirection.

Examples

Bad practice

let v: Arc<Box<str>> = Arc::new(Box::from("str")); // readable across threads

Recommended

let v: Arc<str> = Arc::from("str"); // readable across threads