From 95d96ec41d9613142b89b7a4e77c297a58995e56 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 22 Apr 2021 18:10:09 +0100 Subject: [PATCH] add non_exhaustive to encoder error --- actix-http/src/body/mod.rs | 3 ++- actix-http/src/encoding/encoder.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/actix-http/src/body/mod.rs b/actix-http/src/body/mod.rs index 8346109e8..d21cca60b 100644 --- a/actix-http/src/body/mod.rs +++ b/actix-http/src/body/mod.rs @@ -76,7 +76,6 @@ mod tests { use bytes::{Bytes, BytesMut}; use super::*; - // use crate::Error; impl Body { pub(crate) fn get_ref(&self) -> &[u8] { @@ -239,6 +238,8 @@ mod tests { ); } + // down-casting used to be done with a method on MessageBody trait + // test is kept to demonstrate equivalence of Any trait #[actix_rt::test] async fn test_body_casting() { let mut body = String::from("hello cast"); diff --git a/actix-http/src/encoding/encoder.rs b/actix-http/src/encoding/encoder.rs index bd8c9e991..b8bc8b68d 100644 --- a/actix-http/src/encoding/encoder.rs +++ b/actix-http/src/encoding/encoder.rs @@ -311,6 +311,7 @@ impl ContentEncoder { } #[derive(Debug, Display)] +#[non_exhaustive] pub enum EncoderError { #[display(fmt = "body")] Body(E),