-
Notifications
You must be signed in to change notification settings - Fork 13k
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
libstd: Implement some convenience methods on new vectors #12253
Conversation
@@ -1138,6 +1138,7 @@ impl<'a,T> ImmutableVector<'a, T> for &'a [T] { | |||
} | |||
|
|||
fn map<U>(&self, f: |t: &T| -> U) -> ~[U] { | |||
|
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.
What is this blank line?
@pcwalton this needs rebase |
rebased, r? @brson |
|
||
#[inline] | ||
pub fn map<U>(&self, f: |t: &T| -> U) -> Vec<U> { | ||
self.iter().map(f).collect() |
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.
Do we want to keep using this definition of map
on the new vectors? As I understand it, map
on ~[T]
is considered deprecated for a long time, as iterators allow one to express the same, and if we ever get Iterable
it would conflict anyway.
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.
If it makes landing the ~[]
removable easier, keep it: someone else can remove it later if necessary.
feat: Add binding mode inlay hints ![image](https://user-images.githubusercontent.com/3757771/168427387-2f299438-a0cc-496b-a9a5-d689ef6a2b55.png)
…eds-usize, r=Manishearth fix: ICE when array index exceeds usize fixes rust-lang#12253 This PR fixes ICE in `indexing_slicing` as it panics when the index of the array exceeds `usize`. changelog: none
r? @brson