From 7e22164e635c31b64007bd981ed9c98de62e30df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Gr=C3=B6n?= Date: Tue, 30 Oct 2018 21:03:46 +0100 Subject: [PATCH] Introduce tower_grpc::metadata::MetadataMap type As per the discussion in #90, it wraps http::HeaderMap to abstract away the fact that tower-grpc is HTTP based. At this time this class is a pure wrapper that does not actually implement any of the gRPC metadata specific stuff (such as binary fields), that will come later. --- src/metadata_map.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/metadata_map.rs b/src/metadata_map.rs index 97d35d47..6f84b0e7 100644 --- a/src/metadata_map.rs +++ b/src/metadata_map.rs @@ -220,7 +220,7 @@ impl MetadataMap { /// /// assert_eq!(2, map.len()); /// - /// map.append("x-host-ip", "text/html".parse().unwrap()); + /// map.append("x-mime-type", "text/html".parse().unwrap()); /// /// assert_eq!(3, map.len()); /// ``` @@ -241,12 +241,12 @@ impl MetadataMap { /// /// assert_eq!(0, map.keys_len()); /// - /// map.insert("x-host-ip", "127.0.0.1".parse().unwrap()); - /// map.insert("x-host-name", "localhost".parse().unwrap()); + /// map.insert("x-mime", "text/plain".parse().unwrap()); + /// map.insert("x-host", "localhost".parse().unwrap()); /// /// assert_eq!(2, map.keys_len()); /// - /// map.append("x-host-ip", "text/html".parse().unwrap()); + /// map.insert("x-mime", "text/html".parse().unwrap()); /// /// assert_eq!(2, map.keys_len()); /// ```