From 53746b59e525ff5f518ed59d7831b05e2732785d Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 7 Feb 2024 14:53:13 +0100 Subject: [dep-upgrade-202402] slightly more explicit error management --- src/api/helpers.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/api/helpers.rs') diff --git a/src/api/helpers.rs b/src/api/helpers.rs index 66f4c465..ba7b1599 100644 --- a/src/api/helpers.rs +++ b/src/api/helpers.rs @@ -1,3 +1,5 @@ +use std::convert::Infallible; + use http_body_util::{BodyExt, Full as FullBody}; use hyper::{body::Body, Request, Response}; use idna::domain_to_unicode; @@ -151,10 +153,10 @@ pub fn string_body(s: String) -> BoxBody { bytes_body(bytes::Bytes::from(s.into_bytes())) } pub fn bytes_body(b: bytes::Bytes) -> BoxBody { - BoxBody::new(FullBody::new(b).map_err(|_| unreachable!())) + BoxBody::new(FullBody::new(b).map_err(|_: Infallible| unreachable!())) } pub fn empty_body() -> BoxBody { - BoxBody::new(http_body_util::Empty::new().map_err(|_| unreachable!())) + BoxBody::new(http_body_util::Empty::new().map_err(|_: Infallible| unreachable!())) } pub fn error_body(s: String) -> ErrorBody { ErrorBody::from(bytes::Bytes::from(s.into_bytes())) -- cgit v1.2.3