chore: Replace as_any functions with trait upcasting (#28221)
Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
38ec45008c
commit
0b75c13034
13 changed files with 23 additions and 87 deletions
|
@ -10,7 +10,7 @@ use proto::{
|
|||
error::ErrorExt as _,
|
||||
};
|
||||
use std::{
|
||||
any::TypeId,
|
||||
any::{Any, TypeId},
|
||||
sync::{Arc, Weak},
|
||||
};
|
||||
|
||||
|
@ -250,8 +250,7 @@ impl AnyProtoClient {
|
|||
let message_type_id = TypeId::of::<M>();
|
||||
let entity_type_id = TypeId::of::<E>();
|
||||
let entity_id_extractor = |envelope: &dyn AnyTypedEnvelope| {
|
||||
envelope
|
||||
.as_any()
|
||||
(envelope as &dyn Any)
|
||||
.downcast_ref::<TypedEnvelope<M>>()
|
||||
.unwrap()
|
||||
.payload
|
||||
|
@ -296,8 +295,7 @@ impl AnyProtoClient {
|
|||
let message_type_id = TypeId::of::<M>();
|
||||
let entity_type_id = TypeId::of::<E>();
|
||||
let entity_id_extractor = |envelope: &dyn AnyTypedEnvelope| {
|
||||
envelope
|
||||
.as_any()
|
||||
(envelope as &dyn Any)
|
||||
.downcast_ref::<TypedEnvelope<M>>()
|
||||
.unwrap()
|
||||
.payload
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue