Skip to content

Conversation

@cecton
Copy link
Contributor

@cecton cecton commented Mar 3, 2025

Fixes #60

@cecton cecton requested a review from kirillsemyonkin March 3, 2025 17:35
@kirillsemyonkin
Copy link
Collaborator

does into_iter() provide Ts or &Ts? maybe would be nice to mirror Vec's behavior where iter() gives &T and into_iter() gives T

@cecton
Copy link
Contributor Author

cecton commented Mar 5, 2025

oh wow, so iter() returned owned objects and into_iter() returned references? I did not even implemented that into_iter() stuff xD

@kirillsemyonkin
Copy link
Collaborator

Is there a need for a custom IArrayIter<'a, T>? Is std::slice::Iter via Deref<Target = [T]> not enough?

@cecton
Copy link
Contributor Author

cecton commented Mar 5, 2025

I couldn't make it work but feel free to try.

The into_iter() for IMap is also more complicated than I expected. I don't use map anyway so I would prefer to leave it for later and merge what works for now.

@cecton
Copy link
Contributor Author

cecton commented Mar 5, 2025

I misunderstood IArrayIter with IArrayIntoIter my bad. Well great if it works!

Ready to merge without the map into_iter?

@cecton cecton merged commit de2b23d into yewstack:main Mar 5, 2025
6 checks passed
@cecton cecton deleted the iarray-imap-iter-yields-refs branch March 5, 2025 13:43
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.

Make the iterator yields references

2 participants