Revert "hold raw header string"

This reverts commit 5bb52fbd8c.
This commit is contained in:
yggverse 2025-03-19 15:06:53 +02:00
parent 3f968d87b1
commit 9eb21bb6a3
11 changed files with 78 additions and 278 deletions

View file

@ -5,31 +5,23 @@ use std::{
#[derive(Debug)]
pub enum Error {
Code,
ContentType,
HeaderLen(usize),
Protocol,
Mime,
Utf8Error(Utf8Error),
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> Result {
match self {
Self::Code => {
write!(f, "Unexpected status code")
}
Self::ContentType => {
write!(f, "Content type required")
}
Self::HeaderLen(l) => {
write!(
f,
"Header length reached protocol limit ({l} of {} bytes max)",
super::super::HEADER_LEN
)
}
Self::Utf8Error(e) => {
write!(f, "UTF-8 error: {e}")
}
Self::Protocol => {
write!(f, "Protocol error")
}
Self::Mime => {
write!(f, "MIME error")
}
}
}
}