Skip to content

Iterators in the std library should implement Eq where possible #12593

Closed
@Valloric

Description

@Valloric

[Per discussion with @huonw on #rust.]

I've written a function apply like so:

type ParseState<'a> = Enumerate< Chars<'a> >;

struct ParseResult<'a> {
  value: Option< uint >,  // something more complicated in actual code
  parse_state: ParseState<'a>
}

fn apply<'a>( &self, parse_state: ParseState<'a> ) -> Option< ParseResult<'a> >

The idea is to parse the input and also return an iterator that's correctly advanced. I'm writing a test for this and Iterators not implementing Eq is making this more difficult than it needs to be.

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