mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Fix warning: trait objects without an explicit dyn are deprecated (#8798)
This commit is contained in:
committed by
GitHub
parent
1ac95b6ba6
commit
c6b1240e51
@@ -233,7 +233,7 @@ impl<B, E> Extension for Forks<B, E> where
|
|||||||
|
|
||||||
fn get<T: 'static>(&self) -> Option<&T> {
|
fn get<T: 'static>(&self) -> Option<&T> {
|
||||||
match TypeId::of::<T>() {
|
match TypeId::of::<T>() {
|
||||||
x if x == TypeId::of::<E>() => Any::downcast_ref(&self.base),
|
x if x == TypeId::of::<E>() => <dyn Any>::downcast_ref(&self.base),
|
||||||
_ => self.base.get(),
|
_ => self.base.get(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ impl<B, E> Extension for Forks<B, E> where
|
|||||||
<<Self::Forks as IsForks>::Extension as Group>::Fork: Extension,
|
<<Self::Forks as IsForks>::Extension as Group>::Fork: Extension,
|
||||||
{
|
{
|
||||||
if TypeId::of::<BlockNumber>() == TypeId::of::<B>() {
|
if TypeId::of::<BlockNumber>() == TypeId::of::<B>() {
|
||||||
Any::downcast_ref(&self.for_type::<T>()?).cloned()
|
<dyn Any>::downcast_ref(&self.for_type::<T>()?).cloned()
|
||||||
} else {
|
} else {
|
||||||
self.get::<Forks<BlockNumber, <Self::Forks as IsForks>::Extension>>()?
|
self.get::<Forks<BlockNumber, <Self::Forks as IsForks>::Extension>>()?
|
||||||
.for_type()
|
.for_type()
|
||||||
@@ -275,7 +275,7 @@ impl <E: Extension> GetExtension for E {
|
|||||||
/// Helper function that queries an extension by type from `GetExtension`
|
/// Helper function that queries an extension by type from `GetExtension`
|
||||||
/// trait object.
|
/// trait object.
|
||||||
pub fn get_extension<T: 'static>(e: &dyn GetExtension) -> Option<&T> {
|
pub fn get_extension<T: 'static>(e: &dyn GetExtension) -> Option<&T> {
|
||||||
Any::downcast_ref(GetExtension::get_any(e, TypeId::of::<T>()))
|
<dyn Any>::downcast_ref(GetExtension::get_any(e, TypeId::of::<T>()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user