Skip to content

Commit 221f644

Browse files
committed
docs: Correct comments in HeaderValue::from_maybe_shared_unchecked.
Signed-off-by: Piotr Sikora <code@piotrsikora.dev>
1 parent ed680c4 commit 221f644

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/header/value.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,12 @@ impl HeaderValue {
173173
/// within the buffer.
174174
///
175175
/// ## Panics
176-
/// In a debug build this will panic if `src` is not valid UTF-8.
176+
/// In a debug build this will panic if `src` contains bytes that are not
177+
/// allowed in HTTP field values.
177178
///
178179
/// ## Safety
179-
/// `src` must contain valid UTF-8. In a release build it is undefined
180-
/// behaviour to call this with `src` that is not valid UTF-8.
180+
/// `src` must contain valid HTTP field value. In a release build it is
181+
/// undefined behaviour to call this with `src` that is not valid.
181182
pub unsafe fn from_maybe_shared_unchecked<T>(src: T) -> HeaderValue
182183
where
183184
T: AsRef<[u8]> + 'static,

0 commit comments

Comments
 (0)