Context for the code:
let skipped = HashMap::new();
let mut freefams = 0;
reservations.keys().sorted().for_each(|r#type|{
let v = &reservations[r#type];
if v > &(0 as u64) && usedtypes.contains_key(r#type){
skipped.entry(r#type).or_insert(v);
freefams += 1;
}
});
I get an error stating "the trait Borrow<&str>
is not implemented for &std::string::String
" with the line:
usedtypes.contains_key(r#type)
For reference, usedtypes is a HashMap with key of type String and value of type String.
Thanks for your time and help.