From 176a3a90ae1e10c1feea92f7c65fd0957d6779e5 Mon Sep 17 00:00:00 2001 From: mdecimus Date: Thu, 4 Jul 2024 07:43:17 +0200 Subject: [PATCH] v0.8.4 --- crates/imap/src/op/authenticate.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/imap/src/op/authenticate.rs b/crates/imap/src/op/authenticate.rs index d85d5d57..5846bb44 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;