From 19cee99c3f0eb49c2358d404e566af853ed2794a Mon Sep 17 00:00:00 2001 From: Juan Alvarez Date: Thu, 14 Nov 2019 17:40:22 -0600 Subject: [PATCH] make into_sanitized_headers private --- tonic/src/metadata/map.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/tonic/src/metadata/map.rs b/tonic/src/metadata/map.rs index a6dc17e66..9dab15b9d 100644 --- a/tonic/src/metadata/map.rs +++ b/tonic/src/metadata/map.rs @@ -249,23 +249,7 @@ impl MetadataMap { self.headers } - /// Convert a MetadataMap into a HTTP HeaderMap - /// - /// The returned map excludes headers reserved by the gRPC protocol. - /// - /// # Examples - /// - /// ``` - /// # use tonic::metadata::*; - /// let mut map = MetadataMap::new(); - /// map.insert("grpc-timeout", "1S".parse().unwrap()); - /// map.insert("x-host", "example.com".parse().unwrap()); - /// - /// let http_map = map.into_sanitized_headers(); - /// - /// assert!(http_map.get("grpc-timeout").is_none()); - /// ``` - pub fn into_sanitized_headers(mut self) -> http::HeaderMap { + pub(crate) fn into_sanitized_headers(mut self) -> http::HeaderMap { for r in &Self::GRPC_RESERVED_HEADERS { self.headers.remove(*r); }