Skip to content

Commit 907e883

Browse files
committed
Delete InvalidHeader, which was unused.
1 parent 4525136 commit 907e883

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

src/http/fields.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
pub use http::header::{HeaderMap, HeaderName, HeaderValue};
2-
use http::header::{InvalidHeaderName, InvalidHeaderValue};
32

4-
use super::error::ErrorVariant;
53
use super::{Error, Result};
6-
use std::fmt;
74
use wasi::http::types::Fields;
85

96
pub(crate) fn header_map_from_wasi(wasi_fields: Fields) -> Result<HeaderMap> {
@@ -28,41 +25,3 @@ pub(crate) fn header_map_to_wasi(header_map: &HeaderMap) -> Fields {
2825
}
2926
wasi_fields
3027
}
31-
32-
#[derive(Debug)]
33-
pub(crate) enum InvalidHeader {
34-
Name(InvalidHeaderName),
35-
Value(InvalidHeaderValue),
36-
}
37-
38-
impl fmt::Display for InvalidHeader {
39-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
40-
match self {
41-
Self::Name(e) => e.fmt(f),
42-
Self::Value(e) => e.fmt(f),
43-
}
44-
}
45-
}
46-
47-
impl std::error::Error for InvalidHeader {}
48-
49-
impl From<InvalidHeaderName> for InvalidHeader {
50-
fn from(e: InvalidHeaderName) -> Self {
51-
Self::Name(e)
52-
}
53-
}
54-
55-
impl From<InvalidHeaderValue> for InvalidHeader {
56-
fn from(e: InvalidHeaderValue) -> Self {
57-
Self::Value(e)
58-
}
59-
}
60-
61-
impl From<InvalidHeader> for Error {
62-
fn from(e: InvalidHeader) -> Self {
63-
match e {
64-
InvalidHeader::Name(e) => ErrorVariant::HeaderName(e).into(),
65-
InvalidHeader::Value(e) => ErrorVariant::HeaderValue(e).into(),
66-
}
67-
}
68-
}

0 commit comments

Comments
 (0)