Refactored take_unwrap (libstd/option.rs)#12931
Merged
bors merged 1 commit intorust-lang:masterfrom Mar 16, 2014
aochagavia:option-take_unwrap
Merged
Refactored take_unwrap (libstd/option.rs)#12931bors merged 1 commit intorust-lang:masterfrom aochagavia:option-take_unwrap
bors merged 1 commit intorust-lang:masterfrom
aochagavia:option-take_unwrap
Conversation
Using pattern matching instead of is_some + unwrap
Contributor
Author
|
Why does this happen? It has nothing to do with the refactored function... |
bors
added a commit
that referenced
this pull request
Mar 16, 2014
Using pattern matching instead of is_some + unwrap
lnicola
pushed a commit
to lnicola/rust
that referenced
this pull request
Aug 9, 2022
Add more constructors and entry-APIs for la-arena
`la-arena` on crates.io is quite helpful when just a thin wrapper for Vec with u32 indices is needed.
But the current API is not ergonomic enough.
This PR
- Adds `ArenaMap::new`. Not sure why only `Arena` has it now.
- Adds `Arena{,Map}::with_capacity` for known-size storage.
- Adds entry-API for `ArenaMap` for easier `.entry(idx).or_default().push(value)` or `.entry(idx).or_insert(...)` operations.
lnicola
pushed a commit
to lnicola/rust
that referenced
this pull request
Aug 9, 2022
More methods and traits for `la_arena::ArenaMap` Continue of rust-lang#12931. Seems that I forgot some methods in the previous PR :( I also changed `ArenaMap::insert` to return the old value, to match the map-like collection API of std. **So this is a breaking change.** r? `@lnicola`
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.
Using pattern matching instead of is_some + unwrap