Deprecate panicking .resource
methods
#18084
Closed
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
This PR is a sibling to #18082, and almost all of the motivation there applies here. These methods are much more commonly used in commands, tests and exclusive systems though, and deserve their own judgement call.
Ultimately part of #14275.
Solution
I'm less confident about this PR, and there's 796 warnings in my IDE, so I want to get consensus before burning time on migrating all of these.
TODO:
World::resource
and friends return aResult
for nicer?
ergonomics?Future Work
Move the non-panicking versions to the better names during the 0.17 cycle, just like in #18082.
Migration Guide
World::resource
and all related methods are now deprecated. UseWorld::get_resource
and so on and handle the returnedOption
.