Closed robertdfrench closed 3 years ago
String
implements AsRef<OsStr>
: https://doc.rust-lang.org/std/string/struct.String.html#impl-AsRef%3COsStr%3EAsRef
trait: https://doc.rust-lang.org/std/convert/trait.AsRef.htmlCommand::new
: https://doc.rust-lang.org/std/process/struct.Command.html#method.new
We don't need
Path
anymore, because @calebwherry found that we don't need the Path construction stuff that I assumed we needed on Windows. I also didn't realize thatString
implements a trait calledAsRef<OsStr>
, meaning that it can be passed as a reference tostd::process::Command::new
. So that will bring the number of string types in this code from 3 down to 1!_Originally posted by @robertdfrench in https://github.com/robertdfrench/git-pr/pull/1#discussion_r725710107_