I'm using serde_json which converts json to BTreeMap. I would like to delete some unnecessary keys from it and convert it back to json string.
let mut tree = message.as_object().unwrap();
let mut del_keys = vec!["__BOOL"];
for key in del_keys.iter(){
tree.remove(&key);
}
Error:
error: the trait `core::borrow::Borrow<&str>` is not implemented for the type `collections::string::String` [E0277]
src/main.rs:54 tree.remove(key);
PS: I'm not sure if I can ask very basic questions like this here.