refactor: remove unused EncryptPreference::Reset

This commit is contained in:
link2xt
2025-09-04 05:34:59 +00:00
committed by l
parent ba827283be
commit 9870725d1f

View File

@@ -17,7 +17,6 @@ pub enum EncryptPreference {
#[default] #[default]
NoPreference = 0, NoPreference = 0,
Mutual = 1, Mutual = 1,
Reset = 20,
} }
impl fmt::Display for EncryptPreference { impl fmt::Display for EncryptPreference {
@@ -25,7 +24,6 @@ impl fmt::Display for EncryptPreference {
match *self { match *self {
EncryptPreference::Mutual => write!(fmt, "mutual"), EncryptPreference::Mutual => write!(fmt, "mutual"),
EncryptPreference::NoPreference => write!(fmt, "nopreference"), EncryptPreference::NoPreference => write!(fmt, "nopreference"),
EncryptPreference::Reset => write!(fmt, "reset"),
} }
} }
} }
@@ -155,7 +153,7 @@ mod tests {
Ok(()) Ok(())
} }
// EncryptPreference::Reset is an internal value, parser should never return it // Non-standard values of prefer-encrypt such as `reset` are treated as no preference.
#[test] #[test]
fn test_from_str_reset() -> Result<()> { fn test_from_str_reset() -> Result<()> {
let raw = format!("addr=reset@example.com; prefer-encrypt=reset; keydata={RAWKEY}"); let raw = format!("addr=reset@example.com; prefer-encrypt=reset; keydata={RAWKEY}");