-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .with_args
feature to rust library
#148
Comments
That does sound nice to have! We can also have a more general fn with_command(self, f: impl FnOnce(&mut Self)) -> Self; I would accept a PR for this. |
@NobodyXu
Could you give a concrete example of what would be an instance of function/closure as the argument of the type: I just started playing with the codebase and don't see what such instance would be like (presumably a block of code involving use of some of the existing APIs to do some business, but I just don't visualise how that might be the case) |
@mingmamma the function will be added to |
This features exists in bossy::Command here: https://docs.rs/bossy/latest/bossy/struct.Command.html#method.with_args
It is quite useful, allowing you to write this:
... instead of this:
This saves using the
mut
keyword and a new line, and can even be implemented trivially using an extension traitThe text was updated successfully, but these errors were encountered: