Skip to content

Commit ce122e5

Browse files
committed
Add contains_key to IPersistentMap protocol
1 parent ded6077 commit ce122e5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/protocols/ipersistent_map.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,12 @@ impl persistent_list_map::IPersistentMap for IPersistentMap {
2222
_ => panic!("Called Iterable iter on non-iterable"),
2323
}
2424
}
25+
fn contains_key(&self,key: &Rc<Value>) -> bool {
26+
match &*self.value {
27+
Value::PersistentListMap(plist_map) => {
28+
plist_map.contains_key(key)
29+
},
30+
_ => panic!("Called Iterable iter on non-iterable"),
31+
}
32+
}
2533
}

0 commit comments

Comments
 (0)