Skip to content

Commit 39931eb

Browse files
committed
allow deprecated uninitialized while min Rust is 1.30
1 parent 62f6cd8 commit 39931eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/header/name.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,7 @@ impl HeaderName {
15321532
///
15331533
/// This function normalizes the input.
15341534
pub fn from_bytes(src: &[u8]) -> Result<HeaderName, InvalidHeaderName> {
1535+
#[allow(deprecated)]
15351536
let mut buf = unsafe { mem::uninitialized() };
15361537
match parse_hdr(src, &mut buf, &HEADER_CHARS)?.inner {
15371538
Repr::Standard(std) => Ok(std.into()),
@@ -1580,6 +1581,7 @@ impl HeaderName {
15801581
/// assert!(HeaderName::from_lowercase(b"Content-Length").is_err());
15811582
/// ```
15821583
pub fn from_lowercase(src: &[u8]) -> Result<HeaderName, InvalidHeaderName> {
1584+
#[allow(deprecated)]
15831585
let mut buf = unsafe { mem::uninitialized() };
15841586
match parse_hdr(src, &mut buf, &HEADER_CHARS_H2)?.inner {
15851587
Repr::Standard(std) => Ok(std.into()),
@@ -1639,6 +1641,7 @@ impl HeaderName {
16391641
/// ```
16401642
pub fn from_static(src: &'static str) -> HeaderName {
16411643
let bytes = src.as_bytes();
1644+
#[allow(deprecated)]
16421645
let mut buf = unsafe { mem::uninitialized() };
16431646
match parse_hdr(bytes, &mut buf, &HEADER_CHARS_H2) {
16441647
Ok(hdr_name) => match hdr_name.inner {
@@ -1917,6 +1920,7 @@ impl<'a> HdrName<'a> {
19171920
pub fn from_bytes<F, U>(hdr: &[u8], f: F) -> Result<U, InvalidHeaderName>
19181921
where F: FnOnce(HdrName) -> U,
19191922
{
1923+
#[allow(deprecated)]
19201924
let mut buf = unsafe { mem::uninitialized() };
19211925
let hdr = parse_hdr(hdr, &mut buf, &HEADER_CHARS)?;
19221926
Ok(f(hdr))
@@ -1925,6 +1929,7 @@ impl<'a> HdrName<'a> {
19251929
pub fn from_static<F, U>(hdr: &'static str, f: F) -> U
19261930
where F: FnOnce(HdrName) -> U,
19271931
{
1932+
#[allow(deprecated)]
19281933
let mut buf = unsafe { mem::uninitialized() };
19291934
let hdr = parse_hdr(hdr.as_bytes(), &mut buf, &HEADER_CHARS)
19301935
.expect("static str is invalid name");

0 commit comments

Comments
 (0)