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.
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
Add
array
lang item and[T; N]::map(f: FnMut(T) -> S)
#75212Add
array
lang item and[T; N]::map(f: FnMut(T) -> S)
#75212Changes from all commits
d871818
f6411e4
56a651c
54b821e
412417d
af32db2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This type is functionally equivalent to the one used in array's
into_iter()
, just adding things to the array instead of removing things from it. Should they be unified?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.
ah sorry which in specific are you referring to? Is this one of the PR's open for implementing
IntoIterator for [T; N]
?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.
There's no trait implementation (sadly), but the iterator type itself does exist: https://doc.rust-lang.org/std/array/struct.IntoIter.html
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.
While they are similar, this one does only iterate in one direction so unifying it might take some work. Would you think it's important to do so?
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.
I put it as a question since I'm not sure. My default answer is to reduce the amount of nuanced unsafe code, but if it's awkward to merge then you can probably just leave it -- unless a real libs-impl member says otherwise, of course.
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.
Mm I do feel the use case is sufficiently different from the iterator, so I'm going to leave it for now then, unless there's a reason otherwise.
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.
I think merging that code is too much hassle to be worth it. The iterator also uses a range (to be a doubled ended iterator) which is not required here.