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

Collecting from iterator skips Nth item #365

Closed
Gingeh opened this issue Dec 17, 2024 · 3 comments
Closed

Collecting from iterator skips Nth item #365

Gingeh opened this issue Dec 17, 2024 · 3 comments

Comments

@Gingeh
Copy link

Gingeh commented Dec 17, 2024

Code to reproduce:

use smallvec::SmallVec;

fn main() {
    let input = "0123456";
    let collected: SmallVec<char, 4> = input
        .chars()
        .collect();

    println!("{collected:?}");
    // expected: ['0', '1', '2', '3', '4', '5', '6']
    // actual:   ['0', '1', '2', '3', '5', '6']
}

This only occurs in 2.0 alpha versions, it also did not occur when collecting from a range.

@mbrubeck
Copy link
Collaborator

Thanks for the report! This is fixed in 2.0.0-alpha.9.

@Gingeh
Copy link
Author

Gingeh commented Dec 17, 2024

Thank you! That was very quick

@mbrubeck
Copy link
Collaborator

Just for reference, this bug was introduced in #362. The only affected version was smallvec 2.0.0-alpha.8.

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

No branches or pull requests

2 participants