marcusbuffett / pipe-rename

Rename your files using your favorite text editor
https://crates.io/crates/pipe-rename
MIT License
397 stars 12 forks source link

Directly pass tmpfile.path() to Command::arg #2

Closed robinkrahl closed 4 years ago

robinkrahl commented 4 years ago

tempfile.path() returns a PathBuf, Command::arg accepts something that implements AsRef<OsStr>. As PathBuf already implements AsRef<OsStr>, we can directly pass tempfile.path() to Command::arg instead of converting it to a String.

marcusbuffett commented 4 years ago

Ha, the old way is looking pretty silly now. Thank you! I appreciate the explanation too