Skip to content

Commit

Permalink
Cleanup API
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Dec 13, 2023
1 parent cf395dc commit 56d6a0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cidre/src/ns/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<K: Obj, V: Obj> Dictionary<K, V> {
}

#[objc::msg_send(objectForKey:)]
pub fn obj_for_key<'a>(&'a self, key: &K) -> Option<&'a V>;
pub fn get<'a>(&'a self, key: &K) -> Option<&'a V>;

#[objc::msg_send(copy)]
pub fn copy_ar(&self) -> arc::Rar<Self>;
Expand Down Expand Up @@ -71,7 +71,7 @@ impl<K: Obj, V: Obj> std::ops::Index<&K> for Dictionary<K, V> {
type Output = V;

fn index(&self, index: &K) -> &Self::Output {
self.obj_for_key(index).expect("no entry found for key")
self.get(index).expect("no entry found for key")
}
}

Expand Down

0 comments on commit 56d6a0e

Please # to comment.