Hi Rust community,
after long hours of trying sort things out, I'm still not able to make following piece of code working:
#![allow(unused)]
use std::collections::HashSet;
fn main() {
let mut rows: Vec<_> = (0..9).map(|_| HashSet::<u8>::new()).collect();
rows.get(20).as_mut().unwrap().insert(5);
}
I want to have vector of 9 HashSets (for Sudoku solver) . I want to work on those HashSets, but I'm getting:
cannot borrow data in a &
reference as mutable
I appreciate your help, Thanks