What it does
PathBuf::from
does allocation, but if &Path
is needed, there is no point in having &PathBuf::from(...)
Advantage
Drawbacks
No response
Example
fn use_path(p: &Path) {}
use_path(&PathBuf::from("abc"));
Could be written as:
use_path(Path::new("abc"));
Comparison with existing lints
No response
Additional Context
No response