fixup! add support for the imap quota extension (RFC 2087)
This commit is contained in:
parent
0a9297f0fc
commit
e082d2f4f4
2 changed files with 8 additions and 9 deletions
|
|
@ -2556,9 +2556,10 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn get_quota_with_limits() {
|
fn get_quota_with_limits() {
|
||||||
let response = b"* QUOTA my_root (STORAGE 10 500)\r\n\
|
let response = b"* QUOTA my_root (STORAGE 10 500)\r
|
||||||
a1 OK completed\r\n"
|
a1 OK completed\r
|
||||||
.to_vec();
|
"
|
||||||
|
.to_vec();
|
||||||
let mock_stream = MockStream::new(response);
|
let mock_stream = MockStream::new(response);
|
||||||
let mut session = mock_session!(mock_stream);
|
let mut session = mock_session!(mock_stream);
|
||||||
let quota = session.get_quota("my_root").unwrap();
|
let quota = session.get_quota("my_root").unwrap();
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,10 @@ pub enum QuotaResourceName<'a> {
|
||||||
|
|
||||||
impl<'a> From<&'a str> for QuotaResourceName<'a> {
|
impl<'a> From<&'a str> for QuotaResourceName<'a> {
|
||||||
fn from(input: &'a str) -> Self {
|
fn from(input: &'a str) -> Self {
|
||||||
if input == "STORAGE" {
|
match input {
|
||||||
QuotaResourceName::Storage
|
"STORAGE" => QuotaResourceName::Storage,
|
||||||
} else if input == "MESSAGE" {
|
"MESSAGE" => QuotaResourceName::Message,
|
||||||
QuotaResourceName::Message
|
_ => QuotaResourceName::Atom(Cow::from(input)),
|
||||||
} else {
|
|
||||||
QuotaResourceName::Atom(Cow::from(input))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue