Box<&str>
RS-W1059Box<&str>
is redundant, use Box<str>
instead.
Box<&str>
is a pointer to a pointer.
This adds another level of indirection without any benefit whatsoever.
If the intention is to place a str
on the heap, consider using Box<str>
or String
.
fn get_box_str() -> Box<&'static str> {
Box::from("string")
}
fn get_box_str() -> Box<str> {
Box::from("string")
}