mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
store MIME value in lowercase presentation
This commit is contained in:
parent
d3133f50f7
commit
e456719e58
1 changed files with 4 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ impl Mime {
|
||||||
// Parse meta bytes only
|
// Parse meta bytes only
|
||||||
match buffer.get(..if len > MAX_LEN { MAX_LEN } else { len }) {
|
match buffer.get(..if len > MAX_LEN { MAX_LEN } else { len }) {
|
||||||
Some(value) => match GString::from_utf8(value.into()) {
|
Some(value) => match GString::from_utf8(value.into()) {
|
||||||
Ok(string) => Self::from_string(string.as_str()),
|
Ok(string) => Self::from_string(&string),
|
||||||
Err(e) => Err(Error::Decode(e)),
|
Err(e) => Err(Error::Decode(e)),
|
||||||
},
|
},
|
||||||
None => Err(Error::Protocol),
|
None => Err(Error::Protocol),
|
||||||
|
|
@ -43,16 +43,16 @@ impl Mime {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
}
|
}
|
||||||
match parse(subject) {
|
match parse(subject) {
|
||||||
Some(value) => Ok(Some(Self(value))),
|
Some(value) => Ok(Some(Self(value.to_lowercase()))),
|
||||||
None => Err(Error::Undefined),
|
None => Err(Error::Undefined),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
|
||||||
/// Get `Self` as `&str`
|
/// Get `Self` as lowercase `std::str`
|
||||||
pub fn as_str(&self) -> &str {
|
pub fn as_str(&self) -> &str {
|
||||||
&self.0
|
self.0.as_str()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue