From 1066bcf879a0c8f70cf6e0b1ec78857e728565d8 Mon Sep 17 00:00:00 2001 From: Gleb Pomykalov Date: Fri, 21 Jul 2023 00:41:15 +0200 Subject: [PATCH] improve logs --- src/header/map.rs | 16 ++++++++++++++++ src/header/value.rs | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/header/map.rs b/src/header/map.rs index 1cbd35cd..bd90de03 100644 --- a/src/header/map.rs +++ b/src/header/map.rs @@ -480,6 +480,10 @@ impl HeaderMap { /// /// More capacity than requested may be allocated. /// + /// # Errors + /// + /// This function may return an error if `HeaderMap` exceeds max capacity + /// /// # Examples /// /// ``` @@ -1222,6 +1226,10 @@ impl HeaderMap { /// The key is not updated, though; this matters for types that can be `==` /// without being identical. /// + /// # Errors + /// + /// This function may return an error if `HeaderMap` exceeds max capacity + /// /// # Examples /// /// ``` @@ -1358,6 +1366,10 @@ impl HeaderMap { /// updated, though; this matters for types that can be `==` without being /// identical. /// + /// # Errors + /// + /// This function may return an error if `HeaderMap` exceeds max capacity + /// /// # Examples /// /// ``` @@ -2452,6 +2464,10 @@ impl<'a, T> Entry<'a, T> { /// /// Returns a mutable reference to the **first** value in the entry. /// + /// # Errors + /// + /// This function may return an error if `HeaderMap` exceeds max capacity + /// /// # Examples /// /// ``` diff --git a/src/header/value.rs b/src/header/value.rs index b1197013..bf05f16f 100644 --- a/src/header/value.rs +++ b/src/header/value.rs @@ -492,7 +492,7 @@ mod from_header_name_tests { map.insert( name::ACCEPT, name::HeaderName::from_bytes(b"hello-world").unwrap().into(), - ).unwrap(); + ); assert_eq!( map.get(name::UPGRADE).unwrap(),