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

Remove opaque type on function iter() of IArray #40

Merged
merged 2 commits into from
Nov 1, 2023
Merged

Conversation

cecton
Copy link
Member

@cecton cecton commented Nov 1, 2023

This change is necessary for me to work on NodeSeq on Yew as there is an trait
there that is impossible to implement if the iter() method here returns an
opaque type.

-impl<IN, OUT> IntoIterator for NodeSeq<IN, OUT> {
+impl<IN, OUT: ImplicitClone + 'static> IntoIterator for NodeSeq<IN, OUT> {
     type IntoIter = std::vec::IntoIter<Self::Item>; // this should be the "Iter" type of IArray
     type Item = OUT;
 
     fn into_iter(self) -> Self::IntoIter {
-        self.0.into_iter()
+        self.0.iter().collect::<Vec<_>>().into_iter() // terrible temporary workaround
     }
 }

@cecton cecton marked this pull request as ready for review November 1, 2023 11:10
Copy link
Collaborator

@kirillsemyonkin kirillsemyonkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have anything to say without first hand experience on the issue I guess. Seems fine to me though

@cecton cecton merged commit c4138b6 into yewstack:main Nov 1, 2023
12 checks passed
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

Successfully merging this pull request may close these issues.

2 participants