MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / put

Method put

706-design-hashmap.rs:20–22  ·  view source on GitHub ↗

value will always be non-negative. */

(&mut self, key: i32, value: i32)

Source from the content-addressed store, hash-verified

18
19 /** value will always be non-negative. */
20 fn put(&mut self, key: i32, value: i32) {
21 self.map.insert(key, value);
22 }
23
24 /** Returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key */
25 fn get(&self, key: i32) -> i32 {

Callers 1

mainFunction · 0.80

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected