From d47a8e0d06398ac31aa52e2e7a2cf5b4a96fbcc5 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 16 Aug 2019 11:41:02 +0900 Subject: [PATCH] Add explicit `dyn`s --- actix-http/src/client/connector.rs | 8 ++++---- actix-http/src/error.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actix-http/src/client/connector.rs b/actix-http/src/client/connector.rs index 7d6fca25a..98e8618c3 100644 --- a/actix-http/src/client/connector.rs +++ b/actix-http/src/client/connector.rs @@ -269,9 +269,9 @@ where .map(|protos| protos.windows(2).any(|w| w == H2)) .unwrap_or(false); if h2 { - (Box::new(sock) as Box, Protocol::Http2) + (Box::new(sock) as Box, Protocol::Http2) } else { - (Box::new(sock) as Box, Protocol::Http1) + (Box::new(sock) as Box, Protocol::Http1) } }), ), @@ -288,9 +288,9 @@ where .map(|protos| protos.windows(2).any(|w| w == H2)) .unwrap_or(false); if h2 { - (Box::new(sock) as Box, Protocol::Http2) + (Box::new(sock) as Box, Protocol::Http2) } else { - (Box::new(sock) as Box, Protocol::Http1) + (Box::new(sock) as Box, Protocol::Http1) } }), ), diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index dcbc3cc93..2c01c86db 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -1072,7 +1072,7 @@ mod tests { #[test] fn test_error_casting() { let err = PayloadError::Overflow; - let resp_err: &ResponseError = &err; + let resp_err: &dyn ResponseError = &err; let err = resp_err.downcast_ref::().unwrap(); assert_eq!(err.to_string(), "A payload reached size limit."); let not_err = resp_err.downcast_ref::();