Skip to content
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

Implement into_boxed_slice() and doc-comment it. #190

Merged
merged 1 commit into from Dec 11, 2019

Conversation

L0uisc
Copy link
Contributor

@L0uisc L0uisc commented Dec 11, 2019

Implements into_boxed_slice() as per suggestion in #184.

I didn't write tests, since all I did was to call an existing method of SmallVec, into_vec() to create a Vec from it and then call a method of alloc::vec::Vec, into_boxed_slice() on the resulting Vec. Thus, nothing in my code needs testing, since it is trivially offloading to other methods.

I didn't, however, find a test exercising into_vec(), however. That is maybe something I can do? If so, can I get some pointers to where I should look for example tests and where my tests should live?

EDIT: Never mind, I forgot that unit tests are in the same file, so I scrutinized smallvec_ops.rs to search for a test for into_vec() and couldn't find it.

@mbrubeck
Copy link
Collaborator

@bors-servo r+

Thanks, looks good!

@bors-servo
Copy link
Contributor

📌 Commit 8b72dba has been approved by mbrubeck

@bors-servo
Copy link
Contributor

⌛ Testing commit 8b72dba with merge 731c0e9...

bors-servo pushed a commit that referenced this pull request Dec 11, 2019
Implement into_boxed_slice() and doc-comment it.

Implements `into_boxed_slice()` as per suggestion in #184.

I didn't write tests, since all I did was to call an existing method of `SmallVec`, `into_vec()` to create a `Vec` from it and then call a method of `alloc::vec::Vec`, `into_boxed_slice()` on the resulting `Vec`. Thus, nothing in my code needs testing, since it is trivially offloading to other methods.

I didn't, however, find a test exercising `into_vec()`, however. That is maybe something I can do? If so, can I get some pointers to where I should look for example tests and where my tests should live?

EDIT: Never mind, I forgot that unit tests are in the same file, so I scrutinized smallvec_ops.rs to search for a test for `into_vec()` and couldn't find it.
@bors-servo
Copy link
Contributor

☀️ Test successful - checks-travis
Approved by: mbrubeck
Pushing 731c0e9 to master...

@bors-servo bors-servo merged commit 8b72dba into servo:master Dec 11, 2019
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Dec 19, 2019
Changes in this release:

* Added new method `SmallVec::into_boxed_slice` (servo#190).
* Added new method `IntoIter::as_slice` (servo#182).
* `IntoIter` now implements `Clone` (servo#192).
* Improved documentation and testing (servo#186, servo#189).
* Minor code cleanups (servo#176).
@mbrubeck mbrubeck mentioned this pull request Dec 19, 2019
bors-servo pushed a commit that referenced this pull request Dec 20, 2019
Version 1.1.0

Changes in this release:

* Added new method `SmallVec::into_boxed_slice` (#190).
* Added new methods `IntoIter::as_slice` and `as_mut_slice` (#182).
* `IntoIter` now implements `Clone` (#192).
* Improved documentation and testing (#186, #189).
* Minor code cleanups (#176).

Also added a simple example to the README.
@L0uisc L0uisc deleted the into-boxed-slice branch November 17, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants