Closed sosthene-nitrokey closed 4 months ago
While implementing I realized that &mut LinearMap does not implement IntoIter. Should I add it ?
&mut LinearMap
IntoIter
I currently did not add it to LinearMapView either for symmetry, but that can lead to confusion. For example, the following doesn't compile:
LinearMapView
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 {
replaced by #491
While implementing I realized that
&mut LinearMap
does not implementIntoIter
. 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:The fix is to use instead