Arc<Box<T>>
RS-W1057The Arc<Box<T>>
type is redundant because an Arc
is already a type
that allocates memory on the heap and manages its ownership, so wrapping it
in a Box
provides no additional benefits.
Consider using just Arc<T>
.
let v: Arc<Box<str>> = Arc::new(Box::from("str")); // readable across threads
let v: Arc<str> = Arc::from("str"); // readable across threads