Add inspection utility methods to Env and Key#880
Merged
Zarenor merged 3 commits intolinebender:masterfrom May 5, 2020
Merged
Conversation
xStrom
reviewed
Apr 28, 2020
2fcbb6e to
55ac520
Compare
These are intended for debugging and theme manipulation, not general use.
xStrom
reviewed
May 3, 2020
| if let Some(value) = self.0.map.get(key.key) { | ||
| value | ||
| } else { | ||
| panic!("key for {} not found", key.key) |
Member
There was a problem hiding this comment.
Let's document panic conditions under the Panics header. Take a look at some of the other functions here like try_get.
cmyr
reviewed
May 7, 2020
| /// | ||
| /// *WARNING:* This is not intended for general use, but only for inspecting an `Env` e.g. | ||
| /// for debugging, theme editing, and theme loading. | ||
| pub fn get_all(&self) -> impl ExactSizeIterator<Item = (&String, &Value)> { |
Member
There was a problem hiding this comment.
a little late to the game but I might've just called this iter or iter_raw or something. 🤷
Collaborator
Author
There was a problem hiding this comment.
Ah. Hm. That might have made some idiomatic sense. No reason not to change it. I'll try to find some time this weekend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These are intended for debugging and theme manipulation, not general use.