Method in collections::map · HashMap coil-stdlib

HashMap::size

pub fn size() -> int
Import
use collections::map::{HashMap};
Source: src/collections/map.hy

Returns the number of entries.

Called on a HashMap value as value.size(…).

Returns#

int

Examples#

use collections::map::{HashMap};
use tests::assert;
let m: HashMap<string, int> = HashMap::new();
m.insert("a", 1);
m.insert("b", 2);
m.remove("a");
assert!(m.size() == 1);

See also#

↑ ↓ navigate ↵ open