How to create a HashMap that receives different types?

29 views Asked by At

I need to send String and Integer values ​​to the application, but if I keep it that way, it says that HashMap expects both the key and value as str

let mut json_data = HashMap::new();
json_data.insert("jql","project=ABC");
json_data.insert("startAt",0);
json_data.insert("maxResults",1);

How can I maintain this dynamically? Passing Strings and Integers whenever I want?

0

There are 0 answers