Logo

Programming-Idioms

History of Idiom 170 > diff from v6 to v7

Edit summary for version 7 by GobbleCock:
New Rust implementation by user [GobbleCock]

Version 6

2018-04-08, 20:10:15

Version 7

2018-06-12, 20:57:34

Idiom #170 Get map size

Set n to the number of elements stored in mymap.

This is not always equal to the map capacity.

Idiom #170 Get map size

Set n to the number of elements stored in mymap.

This is not always equal to the map capacity.

Code
let n = mymap.len();
Doc URL
https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html#method.len