mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
refactor: remove .unwrap() from Peerstate.has_verified_key()
This commit is contained in:
committed by
link2xt
parent
23d6012c1f
commit
f7c7f414ed
@@ -450,16 +450,13 @@ impl<'a> Peerstate<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn has_verified_key(&self, fingerprints: &HashSet<Fingerprint>) -> bool {
|
pub fn has_verified_key(&self, fingerprints: &HashSet<Fingerprint>) -> bool {
|
||||||
if self.verified_key.is_some() && self.verified_key_fingerprint.is_some() {
|
if let Some(vkc) = &self.verified_key_fingerprint {
|
||||||
let vkc = self.verified_key_fingerprint.as_ref().unwrap();
|
fingerprints.contains(vkc) && self.verified_key.is_some()
|
||||||
if fingerprints.contains(vkc) {
|
} else {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<crate::key::FingerprintError> for rusqlite::Error {
|
impl From<crate::key::FingerprintError> for rusqlite::Error {
|
||||||
fn from(_source: crate::key::FingerprintError) -> Self {
|
fn from(_source: crate::key::FingerprintError) -> Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user