Open d0u9 opened 2 years ago
let map = Map::from_pin_file("pin_file").unwrap(); let hasmap = HashMap::<u32, u32>::new(&map).unwrap();
The hashmap internally references map, so I can't use hashmap alone without a valid map;
hashmap
map
If there has a way like map::into::<HashMap>(), it will be more convenient:
map::into::<HashMap>()
let map = Map::from_pin_file("pin_file").unwrap(); let hasmap: HashMap<u32, u32> = map.try_into().unwrap();
Hello @d0u9 It's really nice to see you again. Lucky day!
Thanks for your suggestion :+1: It looks like convenient and neat!
The
hashmap
internally referencesmap
, so I can't usehashmap
alone without a validmap
;If there has a way like
map::into::<HashMap>()
, it will be more convenient: