1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 01:32:57 +01:00

Fix two dyn warnings (#1015)

This commit is contained in:
Sven-Hendrik Haase 2019-07-29 06:10:33 +02:00 committed by Nikolay Kim
parent 6f2049ba9b
commit 81ab37f235

View File

@ -89,11 +89,11 @@ pub trait ResponseError: fmt::Debug + fmt::Display {
}
}
impl ResponseError + 'static {
impl dyn ResponseError + 'static {
/// Downcasts a response error to a specific type.
pub fn downcast_ref<T: ResponseError + 'static>(&self) -> Option<&T> {
if self.__private_get_type_id__() == TypeId::of::<T>() {
unsafe { Some(&*(self as *const ResponseError as *const T)) }
unsafe { Some(&*(self as *const dyn ResponseError as *const T)) }
} else {
None
}