Deprecated Query::many and many_mut #18183
Merged
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.
Objective
Alternative to and closes #18120.
Sibling to #18082, see that PR for broader reasoning.
Folks weren't sold on the name
many
(get_many is clearer, and this is rare), and that PR is much more complex.Solution
Query::many
andQuery::many_mut
Mentions of this in the docs can wait until it's fully removed in the 0.17 cycle IMO: it's much easier to catch the problems when doing that.
Testing
CI!
Migration Guide
Query::many
andQuery::many_mut
have been deprecated to reduce panics and API duplication. UseQuery::get_many
andQuery::get_many_mut
instead, and handle theResult
.