Skip to content

Conversation

@sosthene-nitrokey
Copy link
Contributor

While implementing I realized that &mut LinearMap does not implement IntoIter. Should I add it ? 

I currently did not add it to LinearMapView either for symmetry, but that can lead to confusion. For example, the following doesn't compile:

use heapless::{LinearMap, LinearMapView};

let mut map: LinearMap<_, _, 8> = LinearMap::new();
let map_view: &mut LinearMapView<_, _> = &mut map;

for (key, val) in map_view {
    println!("key: {} val: {}", key, val);
}

The fix is to use instead

for (key, val) in &*map_view {

@sosthene-nitrokey
Copy link
Contributor Author

replaced by #491

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.

1 participant