-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Convert all uses of vec::slice to vec::view #3869
Comments
Huh. Maybe at an interface level, but I would quite like the resulting function to be called |
Yes, I think what we actuallly want to do is (1) replace |
I'll tackle this if niko's suggestion is the consensus. Can someone assign this to me if it's good? |
Not sure what the status of this currently is, but in fact just today there was someone in the IRC channel who was halfway to reimplementing |
So it sounds like they've already started on this bug? |
@nickdesaulniers no, I meant that they were accidentally reimplementing slices in their own code because they had thought that |
Nick, I can't seem to assign you, however I think there is no reason not |
Are vec::view and and vec::slice being swapped, or are we discarding the current implementation of vec::slice and renaming vec::view to vec::slice? |
I favor just having one method. |
Just to triple check; prior to any changes, the function signatures look like: pub pure fn slice<T: Copy>(v: &[const T], start: uint, end: uint) -> ~[T];
pub pure fn view<T>(v: &r/[T], start: uint, end: uint) -> &r/[T]; and after: pub pure fn slice<T>(v: &r/[T], start: uint, end: uint) -> &r/[T] I've been working through necessary changes to other places that call slice or view. One issue I'm running into is a few functions such as tail: I don't think it would be a good idea for me to modify vec::tail, vec::tailn, vec::init, but I'm not in a position to make that call. Thanks in advance for the help! |
note: rename mut_view to mut_slice, and const_view to const_slice |
Tests are green for view -> slice rename. Rebasing, then renaming const_view and mut_view |
All done, tests are green. Going to rebase this once more and double check the tests, then pull request inbound. |
Tests green, pull request inbound |
Issue #3869 review? @nikomatsakis Convert all uses of vec::slice to vec::view Issue #3869 Rename const_view to const_slice Renamed mut_view to mut_slice Fix windows build error. `buf` is borrowed by the call to `as_mut_buf()` and so we must invoke `slice()` outside of that call.
This issue may now be closed. @brson |
\o/ |
The text was updated successfully, but these errors were encountered: