Skip to content

Commit 638e74f

Browse files
🎨 remove unneeded casts as they are not needed
1 parent 25c0f91 commit 638e74f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

‎zbus/src/object_server/interface/interface_ref.rs‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ where
2525
pub async fn get(&self) -> InterfaceDeref<'_, I> {
2626
let iface = self.lock.read().await;
2727

28-
iface
29-
.downcast_ref::<I>()
30-
.expect("Unexpected interface type");
31-
3228
InterfaceDeref {
3329
iface,
3430
phantom: PhantomData,
@@ -80,14 +76,7 @@ where
8076
/// # Ok::<_, Box<dyn Error + Send + Sync>>(())
8177
/// ```
8278
pub async fn get_mut(&self) -> InterfaceDerefMut<'_, I> {
83-
let mut iface = self.lock.write().await;
84-
85-
iface
86-
.downcast_ref::<I>()
87-
.expect("Unexpected interface type");
88-
iface
89-
.downcast_mut::<I>()
90-
.expect("Unexpected interface type");
79+
let iface = self.lock.write().await;
9180

9281
InterfaceDerefMut {
9382
iface,

0 commit comments

Comments
 (0)