diff --git a/crates/imap/src/op/authenticate.rs b/crates/imap/src/op/authenticate.rs index d85d5d57e..5846bb445 100644 --- a/crates/imap/src/op/authenticate.rs +++ b/crates/imap/src/op/authenticate.rs @@ -233,14 +233,10 @@ pub fn decode_challenge_plain(challenge: &[u8]) -> Result, & let mut arg_num = 0; for &ch in challenge { if ch != 0 { - match arg_num.cmp(&2) { - std::cmp::Ordering::Less => { - username.push(ch); - } - std::cmp::Ordering::Equal => { - secret.push(ch); - } - std::cmp::Ordering::Greater => (), + if arg_num == 1 { + username.push(ch); + } else if arg_num == 2 { + secret.push(ch); } } else { arg_num += 1;