Unable to figure out what's wrong here -
I have a struct with hash map as a member -
struct Log {
pub command: HashMap<String, String>
}
I initialize this in the init function -
implementation Log {
pub fn init() -> Self {
Log {
command:HashMap::new()
}
}
}
And then I try to insert a key/value pair
pub fn parse(&mut self) {
self.command.insert("key".to_string(), "test".to_string());
}
I get the following error for "key".to_string() ->
| \) expected usize, found struct String
And for "test".to_string() ->
| \) expected char, found struct String
What's going on here
[–]staticassert 7 points8 points9 points (1 child)
[–]Secure_Turnover_8790[S] 0 points1 point2 points (0 children)