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

change drain to be consistent with Vec #142

Closed
lcnr opened this issue Feb 24, 2019 · 2 comments · Fixed by #145
Closed

change drain to be consistent with Vec #142

lcnr opened this issue Feb 24, 2019 · 2 comments · Fixed by #145

Comments

@lcnr
Copy link
Contributor

lcnr commented Feb 24, 2019

drain has a different signature than Vec, in case this is something that is worth fixing, I would be glad to post a PR.

SmallVec: pub fn drain(&mut self) -> Drain<A::Item>
Vec: pub fn drain<R>(&mut self, range: R) -> Drain<T> where R: RangeBounds<usize>

@mbrubeck
Copy link
Collaborator

This will only work on Rust 1.28 and later, because RangeBounds was not stable in earlier versions. (The current version of smallvec is compatible with Rust 1.20.)

I think we should release a new major version of smallvec soon that increases the Rust version requirement, along with making some of the other breaking changes listed in #73. If you'd like to submit a PR for this issue, we can include it in that release.

@lcnr
Copy link
Contributor Author

lcnr commented Mar 7, 2019

This seems far more complicated than expected, as 0..start might be smaller than inline_size which causes problems as the union is suddenly getting misinterpreted. While I think that I have a safe solution, it will take a few more days until it's finished.

Edit: never mind, I have misunderstood how the union feature works.

@lcnr lcnr mentioned this issue Mar 11, 2019
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 a pull request may close this issue.

2 participants