I have a beautified string which I want to associate to a key and I want to display it from a Hashmap or a BTreeMap in Rust. My string is shown below as follows:-
The `beautified_string` which when printed on terminal using println!("{}", beautified_string)
{
"a1": "nWM0MM",
"b1": "YErSKv",
"c1": "B",
"d1": [
"AIBAC",
"AH8EA"
]
}
However, when I associate this to a map like this
let m = BTreeMap::new()
m.insert("a", beautified_string)
When I do println!("{:?}", m)
I get,
{"a": "{\n \"a1\": \"nWM0MM\",\n \"b1\": \"YErSKv\",\n \"c1\": \"B\",\n \"d1\": [\n \"AIBAC\",\n \"AH8EA\"\n ]\n}"}
Is it possible to get an output like this from the map?
"a": {
"a1": "nWM0MM",
"b1": "YErSKv",
"c1": "B",
"d1": [
"AIBAC",
"AH8EA"
]
}