Skip to content

Commit

Permalink
doc(header): add panics and safety section to document
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored and seanmonstar committed Feb 19, 2024
1 parent b8ddea7 commit 63e7d63
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/header/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ impl HeaderValue {
///
/// This function does NOT validate that illegal bytes are not contained
/// within the buffer.
///
/// ## Panics
/// In a debug build this will panic if `src` is not valid UTF-8.
///
/// ## Safety
/// `src` must contain valid UTF-8. In a release build it is undefined
/// behaviour to call this with `src` that is not valid UTF-8.
pub unsafe fn from_maybe_shared_unchecked<T>(src: T) -> HeaderValue
where
T: AsRef<[u8]> + 'static,
Expand Down

0 comments on commit 63e7d63

Please sign in to comment.