Skip to content

Owned iterator: into_ones() #45

@sitegui

Description

@sitegui

Hi,

I'm building a tiny abstraction over this lib for my use case (a set of usizes with an API very similar to BTreeSet) and I'm stuck on the implementation of my IntoIterator because there is no owning equivalent of ones(). I mean, One<'a> iterates over a borrow of the FixedBitSet and I cannot easily keep the FixedBitSet and the One<'_> around on the same struct:

struct IntoIter<'a> {
    bit_set: FixedBitSet,
    ones: Ones<'a>,
}

I'm currently using rental as a workaround, but that is quite complex.

Does it make sense to implement a method like pub fn into_ones(&self) -> IntoOnes? I can work on a PR if you are interested.

Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions