Some cleanups

- Remove unused errors.
- Add doc comments.
This commit is contained in:
Malte Meiboom
2026-05-06 16:30:42 +02:00
parent c0fe0e91ea
commit 21b45d1702
6 changed files with 14 additions and 17 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
//! Error typ
//! Husk Error type
use thiserror::Error;
+4 -9
View File
@@ -6,7 +6,6 @@ use sequoia_wot as wot;
use wot::{CertSynopsis, Certification};
use sequoia_openpgp::{cert::ValidCert, policy::StandardPolicy};
use sequoia_openpgp::Cert;
use sequoia_openpgp::Fingerprint;
use crate::types::husk_context::HuskContext;
use crate::common::crypto;
@@ -15,14 +14,6 @@ use crate::common::crypto;
pub enum IntroducerError {
#[error("Unsuitable certificate")]
UnsuitableCertificate,
#[error("Unlimited introducer")]
UnlimitedIntroducer,
#[error("Invalid domain name: '{0}'")]
InvalidDomainName(String),
#[error("Certificate {0} contains no usable user id")]
NoUserIDs(Fingerprint),
#[error("Local trust root is damanged")]
RootDamaged,
}
#[derive(Debug, Clone)]
@@ -33,6 +24,10 @@ pub struct Introducer {
impl Introducer {
/// Can this introducer potentially introduce `email`?
///
/// This check matches the email with the list of domains of the
/// introducer.
pub fn can_introduce(&self, email: &str) -> bool {
if let Some(regexset) = self.certification.regular_expressions() {
if regexset.matches_everything() {