From 56d6a0e10b1a3123cf8911b66bc32250d9c435c2 Mon Sep 17 00:00:00 2001 From: Yury Korolev Date: Wed, 13 Dec 2023 15:11:58 +0300 Subject: [PATCH] Cleanup API --- cidre/src/ns/dictionary.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cidre/src/ns/dictionary.rs b/cidre/src/ns/dictionary.rs index 6ee51be1..ce4485db 100644 --- a/cidre/src/ns/dictionary.rs +++ b/cidre/src/ns/dictionary.rs @@ -42,7 +42,7 @@ impl Dictionary { } #[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; @@ -71,7 +71,7 @@ impl std::ops::Index<&K> for Dictionary { 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") } }