Skip to content

Allow to use for on references to IntMap#96

Merged
JesperAxelsson merged 1 commit into
JesperAxelsson:masterfrom
TrAyZeN:master
Jul 3, 2025
Merged

Allow to use for on references to IntMap#96
JesperAxelsson merged 1 commit into
JesperAxelsson:masterfrom
TrAyZeN:master

Conversation

@TrAyZeN
Copy link
Copy Markdown
Contributor

@TrAyZeN TrAyZeN commented Jul 2, 2025

Hello,

Currently, doing a for loop on a reference to IntMap does not work. As an example, the following code does not compile.

let mut map: IntMap<u64, u64> = IntMap::new();

for (k, v) in &map {
    // ...
}

for (k, v) in &mut map {
    // ...
}

This PR implements IntoIterator on &IntMap and &mut IntMap to solve this issue.

@JesperAxelsson
Copy link
Copy Markdown
Owner

Looks good thanks!

@JesperAxelsson JesperAxelsson merged commit e18a4bb into JesperAxelsson:master Jul 3, 2025
2 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