Implement Deref to be able to use std::process:Command methods#9
Implement Deref to be able to use std::process:Command methods#9sharkdp merged 2 commits intosharkdp:masterfrom
Conversation
|
I think I tried this in #3 but backed it out to avoid bumping the MSRV. Maybe we could just impl Deref and get all the methods for free? |
I actually considered that, but thought there was a strategy behind not exposing process::Command. Will push a new commit where I implement Deref, as I also think it is the best solution here 🙂 Kept the other methods that was added in your PR for now, but they can probably be removed. |
|
Removed the usage of get_program in the test now, as it seems to have caused the minimum supported rust version error. |
|
The
I'd be in favor of that! How does it change the documentation output? Would users still see the full |
My bad. It seems like most of those methods require us to implement |
|
We shouldn't implement DerefMut anyway as then users can bypass the command size accounting |
|
Ok, thank you! |
I find this useful in std::process:Command. Useful for possible solutions to something like (writing custom formatting methods for it):
sharkdp/fd#1083
...and off course other places where argmax is used and we want to print the program name for whatever reason. It will include the entire path given to std::process:Command::new.
Feel free to ignore/close if this is something that has already been considered, or if you just think it is stupid 🙂