From d9a8f103240feef7fdfa0a3e0ca59caf0bacf348 Mon Sep 17 00:00:00 2001 From: tottoto Date: Tue, 14 Feb 2023 23:47:11 +0900 Subject: [PATCH] chore(tonic): Remove duplicated code (#1267) --- tonic/src/body.rs | 2 -- tonic/src/codegen.rs | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tonic/src/body.rs b/tonic/src/body.rs index 53a917e..ef95eec 100644 --- a/tonic/src/body.rs +++ b/tonic/src/body.rs @@ -14,8 +14,6 @@ where body.map_err(crate::Status::map_error).boxed_unsync() } -// this also exists in `crate::codegen` but we need it here since `codegen` has -// `#[cfg(feature = "codegen")]`. /// Create an empty `BoxBody` pub fn empty_body() -> BoxBody { http_body::Empty::new() diff --git a/tonic/src/codegen.rs b/tonic/src/codegen.rs index b8dd39c..09a504c 100644 --- a/tonic/src/codegen.rs +++ b/tonic/src/codegen.rs @@ -23,8 +23,4 @@ pub mod http { pub use http::*; } -pub fn empty_body() -> crate::body::BoxBody { - http_body::Empty::new() - .map_err(|err| match err {}) - .boxed_unsync() -} +pub use crate::body::empty_body;