filmov
tv
Hash Maps - Rust Programming #rustlang #shorts
Показать описание
In Rust, you can use hash maps to create a map. Use insert to add data into the map.
Get value
Use get to get the value of a key. Get returns an Option, which is None if the key is not in the map.
Iterate
You can iterate over a map using a for loop. The for loop will iterate over a tuple of the key and value.
#coding
Get value
Use get to get the value of a key. Get returns an Option, which is None if the key is not in the map.
Iterate
You can iterate over a map using a for loop. The for loop will iterate over a tuple of the key and value.
#coding