original key in RustcOccupiedEntry#719
Conversation
|
Note that this used to hold the lookup key, but that was removed in #535. See also rust-lang/rust#44286 |
|
I gave some alternate suggestions on rust-lang/rust#155360 |
|
Could you instead change |
57dcc94 to
c36daab
Compare
c36daab to
d49634b
Compare
| /// This `enum` is constructed from the [`rustc_entry`] method on [`HashMap`]. | ||
| /// | ||
| /// [`rustc_entry`]: HashMap::rustc_entry | ||
| pub enum RustcEntry<'a, K, V, A = Global> |
There was a problem hiding this comment.
Tangentially -- I don't think we need any of these RustcEntry methods, because all std does is immediately deconstruct the variants into its own enum. Maybe we could even remove enum RustcEntry altogether and use a Result, like fn rustc_entry(..) -> Result<(Occupied, key), Vacant>.
|
Just so we're on the same page, I was under the impression that One thing that had come to mind was just having multiple entry types based upon what functionality is desired, and having both be public API for this crate so we don't need to make this an internal module. Not that this move should happen here, just, a potential justification for not just making methods return a key + entry and instead making it part of the entry, if it's going to be needed longer term for this. |
|
The main reason |
I'm actually having second thoughts about this since it would mean yet another major version bump for |
|
Isn't |
|
Does An alternative is to add a new method, so we avoid perturbing the performance of the normal Then the parts in the |
|
See #722 for |
This is required for rust-lang/rust#155360
Adds an
original_keyfield toRustcOccupiedEntry