Skip to content

Commit 63e7d63

Browse files
tottotoseanmonstar
authored andcommitted
doc(header): add panics and safety section to document
1 parent b8ddea7 commit 63e7d63

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/header/value.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ impl HeaderValue {
198198
///
199199
/// This function does NOT validate that illegal bytes are not contained
200200
/// within the buffer.
201+
///
202+
/// ## Panics
203+
/// In a debug build this will panic if `src` is not valid UTF-8.
204+
///
205+
/// ## Safety
206+
/// `src` must contain valid UTF-8. In a release build it is undefined
207+
/// behaviour to call this with `src` that is not valid UTF-8.
201208
pub unsafe fn from_maybe_shared_unchecked<T>(src: T) -> HeaderValue
202209
where
203210
T: AsRef<[u8]> + 'static,

0 commit comments

Comments
 (0)