Uh oh!
There was an error while loading. Please reload this page.
Introduce as_slice/as_mut_slice methods on std::vec::IntoIter struct. - #35447
Conversation
rust-highfive
commented
Aug 7, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
apasel422
commented
Aug 7, 2016
This could also have |
frewsxcv
commented
Aug 7, 2016
I think so. I can add it in.
This works for me too; if anyone has strong opinions on this let me know. |
eddyb
commented
Aug 7, 2016
Aren't trait impls insta-stable? |
as_slice method on std::vec::IntoIter struct.as_slice/as_mut_slice methods on std::vec::IntoIter struct.290d093 to
684800fCompare6a7fa66 to
ce58686Comparealexcrichton
commented
Aug 11, 2016
bors
commented
Aug 11, 2016
📌 Commit ce58686 has been approved by |
alexcrichton
commented
Aug 11, 2016
@bors: r- Er wait actually, could you open a tracking issue for these methods and update the unstable issue reference? |
Similar to the `as_slice` method on `core::slice::Iter` struct.
ce58686 to
01a766eComparefrewsxcv
commented
Aug 11, 2016
Done. diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index bce1fca..a6f817a 100644
--- a/src/libcollections/vec.rs+++ b/src/libcollections/vec.rs@@ -1726,7 +1726,7 @@ impl<T> IntoIter<T> {
/// let _ = into_iter.next().unwrap();
/// assert_eq!(into_iter.as_slice(), &['b', 'c']);
/// ```
- #[unstable(feature = "vec_into_iter_as_slice", issue = "0")]+ #[unstable(feature = "vec_into_iter_as_slice", issue = "35601")]
pub fn as_slice(&self) -> &[T] {
unsafe {
slice::from_raw_parts(self.ptr, self.len())
@@ -1747,7 +1747,7 @@ impl<T> IntoIter<T> {
/// assert_eq!(into_iter.next().unwrap(), 'b');
/// assert_eq!(into_iter.next().unwrap(), 'z');
/// ```
- #[unstable(feature = "vec_into_iter_as_slice", issue = "0")]+ #[unstable(feature = "vec_into_iter_as_slice", issue = "35601")]
pub fn as_mut_slice(&self) -> &mut [T] {
unsafe {
slice::from_raw_parts_mut(self.ptr, self.len()) |
alexcrichton
commented
Aug 11, 2016
@bors: r+ Thanks! |
bors
commented
Aug 11, 2016
📌 Commit 01a766e has been approved by |
…alexcrichton Introduce `as_slice`/`as_mut_slice` methods on `std::vec::IntoIter` struct. Similar to the `as_slice` method on `core::slice::Iter` struct.
…alexcrichton Introduce `as_slice`/`as_mut_slice` methods on `std::vec::IntoIter` struct. Similar to the `as_slice` method on `core::slice::Iter` struct.
bors
commented
Aug 14, 2016
⌛ Testing commit 01a766e with merge a9a61fb... |
bors
commented
Aug 14, 2016
💔 Test failed - auto-linux-64-debug-opt |
alexcrichton
commented
Aug 14, 2016
@bors: retry On Sat, Aug 13, 2016 at 8:36 PM, bors notifications@github.com wrote:
|
eddyb
commented
Aug 14, 2016
@bors rollup |
…alexcrichton Introduce `as_slice`/`as_mut_slice` methods on `std::vec::IntoIter` struct. Similar to the `as_slice` method on `core::slice::Iter` struct.
…alexcrichton Introduce `as_slice`/`as_mut_slice` methods on `std::vec::IntoIter` struct. Similar to the `as_slice` method on `core::slice::Iter` struct.
Rollup of 30 pull requests - Successful merges: #34941, #35392, #35444, #35447, #35491, #35533, #35539, #35558, #35573, #35574, #35577, #35586, #35588, #35594, #35596, #35597, #35598, #35606, #35611, #35615, #35616, #35620, #35622, #35640, #35643, #35644, #35646, #35647, #35648, #35661 - Failed merges: #35395, #35415
Display all the remaining items of the iterator, similar to the `Debug` implementation for `core::slice::Iter`: https://github.com/rust-lang/rust/blob/f0bab98695f0a4877daabad9a5b0ba3e66121392/src/libcore/slice.rs#L930-L937 Using the `as_slice` method that was added in: rust-lang#35447
apasel422
commented
Aug 16, 2016
The switch from I thought we had tests for this. |
…xcrichton Implement `Debug` for `std::vec::IntoIter`. Display all the remaining items of the iterator, similar to the `Debug` implementation for `core::slice::Iter`: https://github.com/rust-lang/rust/blob/f0bab98695f0a4877daabad9a5b0ba3e66121392/src/libcore/slice.rs#L930-L937 Using the `as_slice` method that was added in: rust-lang#35447
…xcrichton Implement `Debug` for `std::vec::IntoIter`. Display all the remaining items of the iterator, similar to the `Debug` implementation for `core::slice::Iter`: https://github.com/rust-lang/rust/blob/f0bab98695f0a4877daabad9a5b0ba3e66121392/src/libcore/slice.rs#L930-L937 Using the `as_slice` method that was added in: rust-lang#35447
Similar to the
as_slicemethod oncore::slice::Iterstruct.