Open
Description
What it does
Checks whether a &str
is wrapped in Path::new
before being passed to a function that accepts impl AsRef<Path>
. So somewhat similar to needless_borrow
Advantage
- more concise
- avoids the import
Drawbacks
can't think of any...
Example
std::fs::write(Path::new("foo.txt"), "foo");
Could be written as:
std::fs::write("foo.txt", "foo");