-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Index all the collections #16195
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
Index all the collections #16195
Conversation
Index operations should probably be |
I’ve updated some (hopefully all) examples to use indexing, and The reason I only migrated some code is because that was all that seemed to trigger the deprecation warning when I compiled rustc and ran the tests. |
@@ -1606,7 +1610,7 @@ impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> { | |||
/// use std::collections::HashMap; | |||
/// | |||
/// let mut map = HashMap::new(); | |||
/// map.insert("a", 1i); | |||
// map.insert("a", 1i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidental drop of a slash?
cc @aturon, given these guidelines I would like to r+ this, but would like to confirm just to make sure. |
LGTM. We'll eventually want to migrate the |
Updated; tests should be passing now. r? |
@@ -139,6 +139,8 @@ impl<T> RingBuf<T> { | |||
/// # Example | |||
/// | |||
/// ```rust | |||
/// #![allow(deprecated)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these attributes be placed only on the items where they're needed -- looks like the Index
implementation? That way we don't accidentally start sneaking in other deprecated items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nevermind, this is in an example. Sorry!
This also deprecates RingBuf::get. Use indexing instead.
This also deprecates HashMap::get. Use indexing instead.
This also deprecates SmallIntMap::get. Use indexing instead.
Updated again; tests pass locally now. (Sorry for the other failures.) re-r? |
No worries, thanks for updating! |
Implement `Index` for `RingBuf`, `HashMap`, `TreeMap`, `SmallIntMap`, and `TrieMap`. If there’s anything that I missed or should be removed, let me know.
…ykril Add `toggle_async_sugar` assist code action Implement code action for sugaring and de-sugaring asynchronous functions. This code action does not import `Future` trait when de-sugaring and does not touch function boby, I guess this can be implemented later if needed. This action also does not take into consideration other bounds because IMO it's usually "let me try to use sugared version here". Feel free to request changes, that's my first code action implementation 😄 Closes rust-lang#17010 Relates to rust-lang#16195
Implement
Index
forRingBuf
,HashMap
,TreeMap
,SmallIntMap
, andTrieMap
.If there’s anything that I missed or should be removed, let me know.