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

Docs, code cleanup, and misc. fixes for smallvec #40

Merged
merged 8 commits into from Dec 6, 2016

Conversation

@mbrubeck
Copy link
Contributor

mbrubeck commented Dec 5, 2016

This change is Reviewable

@mbrubeck mbrubeck force-pushed the mbrubeck:docs branch 2 times, most recently from c0f6ad0 to 3ac0159 Dec 5, 2016
@Ms2ger
Ms2ger approved these changes Dec 5, 2016
lib.rs Outdated
@@ -130,13 +150,45 @@ impl<A: Array> Drop for SmallVecData<A> {
}
}


/// A Vec-like that can store a small number of elements inline.

This comment has been minimized.

@Ms2ger

Ms2ger Dec 5, 2016

Contributor
`Vec`-like
lib.rs Outdated
@@ -245,6 +310,9 @@ impl<A: Array> SmallVec<A> {
}
}

/// Reserve capacity for at least `additional` more elements to be inserted.
///
/// May reserve more space to avoid frequent reallocations.

This comment has been minimized.

@Ms2ger

Ms2ger Dec 5, 2016

Contributor

Maybe make a note about overflow behaviour. In particular, it is not safe to assume that you can actually fit additional new elements in it!

lib.rs Outdated
if self.spilled() && self.capacity() > len {
if len <= self.inline_size() {
unsafe {
let (ptr, capacity) = match &self.data {

This comment has been minimized.

@Ms2ger

Ms2ger Dec 5, 2016

Contributor

Why borrow self.data?

@mbrubeck mbrubeck force-pushed the mbrubeck:docs branch from 3ac0159 to 7ca4463 Dec 6, 2016
@mbrubeck
Copy link
Contributor Author

mbrubeck commented Dec 6, 2016

@bors-servo r=Ms2ger

  • Addressed review comments
  • Added some whitespace cleanup
  • Bumped patch version
@bors-servo
Copy link
Contributor

bors-servo commented Dec 6, 2016

📌 Commit 7ca4463 has been approved by Ms2ger

@bors-servo
Copy link
Contributor

bors-servo commented Dec 6, 2016

Test exempted - status

@bors-servo bors-servo merged commit 7ca4463 into servo:master Dec 6, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
bors-servo added a commit that referenced this pull request Dec 6, 2016
Docs, code cleanup, and misc. fixes for smallvec

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/40)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.