MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / insert

Function insert

publication/code/chapter08/rbtree.rs:963–970  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

961 }
962
963 fn insert() {
964 let mut rbt = RBTree::<usize, char>::new();
965 for (k, v) in String::from("I miss you!").chars().enumerate() {
966 rbt.insert(k, v);
967 }
968 let s: String = rbt.iter().map(|x| x.val).collect();
969 assert_eq!(s, "I miss you!");
970 }
971
972 fn delete() {
973 let mut rbt = RBTree::<usize, char>::new();

Callers 1

mainFunction · 0.70

Calls 2

insertMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected