Closed Chriscbr closed 8 months ago
https://doc.rust-lang.org/std/ops/trait.Index.html
let mut m: SparseMap<u32, u32> = SparseMap::new(); m.insert(13, 2); m.insert(8, 16); { let x = m[13]; let y = &mut m[8]; *y += 1; } for Pair {key, value} in m.iter() { println!("{key}:{value}"); // 13:2, 8:17 }
https://doc.rust-lang.org/std/ops/trait.Index.html