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

Missing concrete return type for Iter::by_vals #169

Closed
dignifiedquire opened this issue Apr 5, 2022 · 3 comments
Closed

Missing concrete return type for Iter::by_vals #169

dignifiedquire opened this issue Apr 5, 2022 · 3 comments

Comments

@dignifiedquire
Copy link

I trying to upgrade from 0.22 to 1.0 and running into the following issue.
I have a trait like this

pub trait MyTrait {
  type Iter: Iterator<Item = bool>;
  fn iter(self) -> Self::Iter;
}

which currently is implemented using sth like this:

pub struct Foo {
  bv: BitVec,
}

impl<'a> MyTrait for &'a Foo {
  type Iter: bitvec::slice::BitValIter<'a, Lsb0, usize>;
  fn iter(self) -> Self::Iter {
    self.bv.iter().by_val()
  }
}

Unfortunately in 1.0 calling .by_vals() returns an opaque type (impl Iterator<Item = bool>) which I cannot use anymore in this trait definition. Any pointers on how to either work around this, or if this could be changed to return a concrete type again? Thank you

@dignifiedquire
Copy link
Author

@myrrlyn any thoughts?

@myrrlyn myrrlyn closed this as completed in 591199e Jul 5, 2022
@myrrlyn
Copy link
Collaborator

myrrlyn commented Jul 5, 2022

You're right. I didn't think about that when I made the switch. Since this should be a patch-compatible change, it'll be in 1.0.2.

@dignifiedquire
Copy link
Author

thank you!

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