fix: Change IntoApp::into_app
to CommandFactory::command
#3473
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up to #3472 and is part of resolving #3089.
With
Command
renamed, we need to handle the renaming ofIntoApp::into_app
.into_*
functions are meant to takeself
as a parameter (see https://rust-lang.github.io/api-guidelines/naming.html#c-conv) which this does not. I think switching tocommand
is sufficient for the function. That leaves naming the trait. Java has given a lot of us a negative feeling towards the nameFactory
but calling this aCommandFactory
is the best, descriptive name I've been able to come up with.For compatibility, we
pub use CommandFactory as IntoApp
and havecommand()
be an inherent function that calls the deprecatedinto_app
. While in #3472, I shied away from usinguse
because it doesn't trigger the deprecation warning, this was the best option I had for a trait. This at least ensures all new users will use the new name and existing users are getting the opportunity to migrate, even if they won't get a notification.