mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 13:26:28 +03:00
refactor: derive Default for CertificateChecks
This commit is contained in:
@@ -10,7 +10,7 @@ use crate::provider::Socket;
|
|||||||
use crate::provider::{get_provider_by_id, Provider};
|
use crate::provider::{get_provider_by_id, Provider};
|
||||||
use crate::socks::Socks5Config;
|
use crate::socks::Socks5Config;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Display, FromPrimitive, ToPrimitive, PartialEq, Eq)]
|
#[derive(Copy, Clone, Debug, Default, Display, FromPrimitive, ToPrimitive, PartialEq, Eq)]
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[strum(serialize_all = "snake_case")]
|
#[strum(serialize_all = "snake_case")]
|
||||||
pub enum CertificateChecks {
|
pub enum CertificateChecks {
|
||||||
@@ -30,6 +30,7 @@ pub enum CertificateChecks {
|
|||||||
/// means that provider database setting should be taken.
|
/// means that provider database setting should be taken.
|
||||||
/// If there is no provider database setting for certificate checks,
|
/// If there is no provider database setting for certificate checks,
|
||||||
/// `Automatic` is the same as `Strict`.
|
/// `Automatic` is the same as `Strict`.
|
||||||
|
#[default]
|
||||||
Automatic = 0,
|
Automatic = 0,
|
||||||
|
|
||||||
Strict = 1,
|
Strict = 1,
|
||||||
@@ -41,12 +42,6 @@ pub enum CertificateChecks {
|
|||||||
AcceptInvalidCertificates = 3,
|
AcceptInvalidCertificates = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for CertificateChecks {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::Automatic
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Login parameters for a single server, either IMAP or SMTP
|
/// Login parameters for a single server, either IMAP or SMTP
|
||||||
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct ServerLoginParam {
|
pub struct ServerLoginParam {
|
||||||
|
|||||||
Reference in New Issue
Block a user