refactor: get rid of indexing and slicing in check_armored_payload() (#15)

Indexing can potentially panic, without indexing
it is easier to make sure there will be no crash.
This commit is contained in:
l
2026-01-21 14:25:40 +01:00
committed by GitHub
parent 353f1dc77d
commit f2f7767b71
2 changed files with 13 additions and 19 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ pub fn check_encrypted(mail: &mailparse::ParsedMail, outgoing: bool) -> bool {
return false;
}
};
if !check_armored_payload(payload, outgoing) {
if !check_armored_payload(&payload, outgoing) {
log::debug!("check_encrypted: armored payload check failed");
return false;
}