new()
RS-W1079The new()
function is used to initialise an object with specific data.
If no arguments are passed, the behaviour is identical to default()
.
Replace it with default()
instead.
fn foo() {
let s = String::new();
let p = Path::new();
}
fn foo() {
let s = String::default();
let p = Path::default();
}