-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SortedMap upgrades #56039
SortedMap upgrades #56039
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
ef967be
to
9a402f4
Compare
Whoops, I made a mistake while salvaging the |
9a402f4
to
f552f31
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
It appears @estebank might currently be unavailable . |
(I'm waiting with a fix until the iterator approach is decided) |
Ping from triage @matthewjasper / @ljedrz: What is the status of this PR?
Does that refer to the inline discussion with @bluss? |
@TimNN Yes, I would like to hear some feedback on compatibility vs. simplicity in the implementation of |
ping from triage @ljedrz @bluss @matthewjasper what's the update on this? |
f552f31
to
5b6401f
Compare
@Dylan-DPC I decided to keep the bits that add new functionalities and improve compatibility with |
@bors r+ |
📌 Commit 5b6401f has been approved by |
⌛ Testing commit 5b6401f with merge c7806890dcc8a4fa868502393e166b744f86f18a... |
💔 Test failed - status-appveyor |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors: retry
|
⌛ Testing commit 5b6401f with merge 90d5a2913a62e1b34db0df4c95c8b90b351e30c6... |
💔 Test failed - status-appveyor |
@bors: retry |
SortedMap upgrades - change the impl `From<Iterator<I>>` to `FromIterator<I>` - make the impls of `Index` and `get` match the ones from `BTreeMap` - add `is_empty` and `contains_key` - readability/whitespace fixes - add a proper `Iterator` implementation - `impl IntoIterator for &SortedMap` These changes make `SortedMap` almost a drop-in replacement for `BTreeMap`, at least to the point it is used by `rustc`; what is left is `Entry` API that I'd like to follow this PR with, and possibly implementing `ParallelIterator`.
☀️ Test successful - status-appveyor, status-travis |
should SortedMap.is_empty() just call self.data.is_empty()? |
@leonardo-m I guess it would be a bit more direct, but since both |
From<Iterator<I>>
toFromIterator<I>
Index
andget
match the ones fromBTreeMap
is_empty
andcontains_key
Iterator
implementationimpl IntoIterator for &SortedMap
These changes make
SortedMap
almost a drop-in replacement forBTreeMap
, at least to the point it is used byrustc
; what is left isEntry
API that I'd like to follow this PR with, and possibly implementingParallelIterator
.