Skip to content

Commit 8f52545

Browse files
committed
allow deprecated uninitialized while min Rust is 1.30
1 parent 90b0358 commit 8f52545

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/header/name.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,7 @@ impl HeaderName {
16591659
/// This function normalizes the input.
16601660
#[allow(deprecated)]
16611661
pub fn from_bytes(src: &[u8]) -> Result<HeaderName, InvalidHeaderName> {
1662+
#[allow(deprecated)]
16621663
let mut buf = unsafe { mem::uninitialized() };
16631664
match parse_hdr(src, &mut buf, &HEADER_CHARS)?.inner {
16641665
Repr::Standard(std) => Ok(std.into()),
@@ -1708,6 +1709,7 @@ impl HeaderName {
17081709
/// ```
17091710
#[allow(deprecated)]
17101711
pub fn from_lowercase(src: &[u8]) -> Result<HeaderName, InvalidHeaderName> {
1712+
#[allow(deprecated)]
17111713
let mut buf = unsafe { mem::uninitialized() };
17121714
match parse_hdr(src, &mut buf, &HEADER_CHARS_H2)?.inner {
17131715
Repr::Standard(std) => Ok(std.into()),
@@ -1768,6 +1770,7 @@ impl HeaderName {
17681770
#[allow(deprecated)]
17691771
pub fn from_static(src: &'static str) -> HeaderName {
17701772
let bytes = src.as_bytes();
1773+
#[allow(deprecated)]
17711774
let mut buf = unsafe { mem::uninitialized() };
17721775
match parse_hdr(bytes, &mut buf, &HEADER_CHARS_H2) {
17731776
Ok(hdr_name) => match hdr_name.inner {
@@ -2063,6 +2066,7 @@ impl<'a> HdrName<'a> {
20632066
pub fn from_bytes<F, U>(hdr: &[u8], f: F) -> Result<U, InvalidHeaderName>
20642067
where F: FnOnce(HdrName) -> U,
20652068
{
2069+
#[allow(deprecated)]
20662070
let mut buf = unsafe { mem::uninitialized() };
20672071
let hdr = parse_hdr(hdr, &mut buf, &HEADER_CHARS)?;
20682072
Ok(f(hdr))
@@ -2072,6 +2076,7 @@ impl<'a> HdrName<'a> {
20722076
pub fn from_static<F, U>(hdr: &'static str, f: F) -> U
20732077
where F: FnOnce(HdrName) -> U,
20742078
{
2079+
#[allow(deprecated)]
20752080
let mut buf = unsafe { mem::uninitialized() };
20762081
let hdr = parse_hdr(hdr.as_bytes(), &mut buf, &HEADER_CHARS)
20772082
.expect("static str is invalid name");

0 commit comments

Comments
 (0)