fixup! add support for the imap quota extension (RFC 2087)

This commit is contained in:
Edward Rudd 2022-10-25 15:26:36 -04:00
parent 0a9297f0fc
commit e082d2f4f4
2 changed files with 8 additions and 9 deletions

View file

@ -2556,9 +2556,10 @@ mod tests {
#[test]
fn get_quota_with_limits() {
let response = b"* QUOTA my_root (STORAGE 10 500)\r\n\
a1 OK completed\r\n"
.to_vec();
let response = b"* QUOTA my_root (STORAGE 10 500)\r
a1 OK completed\r
"
.to_vec();
let mock_stream = MockStream::new(response);
let mut session = mock_session!(mock_stream);
let quota = session.get_quota("my_root").unwrap();

View file

@ -49,12 +49,10 @@ pub enum QuotaResourceName<'a> {
impl<'a> From<&'a str> for QuotaResourceName<'a> {
fn from(input: &'a str) -> Self {
if input == "STORAGE" {
QuotaResourceName::Storage
} else if input == "MESSAGE" {
QuotaResourceName::Message
} else {
QuotaResourceName::Atom(Cow::from(input))
match input {
"STORAGE" => QuotaResourceName::Storage,
"MESSAGE" => QuotaResourceName::Message,
_ => QuotaResourceName::Atom(Cow::from(input)),
}
}
}