Skip to content

ArrayChunks::into_remainder does not return None when there is no remainder #116000

Description

@hkBst

I tried this code:

#![feature(iter_array_chunks)]

fn main() {
    let line = "abc";
    let mut chunks = line.chars().array_chunks::<3>();
    let _result: Vec<_> = chunks.by_ref().collect();
    if let Some(rem) = chunks.into_remainder() {
        assert!(rem.count() != 0);
    }
}

I expected to see this happen: into_remainder returns None when there is no remainder

Instead, this happened: into_remainder returns Some of an iterator with zero elements

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions