Rust

Rust

By DeepSource

Found occurrence of `Box<String>`RS-W1060

Anti-pattern

Box<String> is unnecessary. Strings are already stored on the heap, boxing them simply adds another level of indirection. Consider using Box<str> or String instead.

Examples

Bad practice

let temp: Box<String> = Box::new("test".to_string());

Recommended

let temp: String = "test".to_string();