mirror of
https://github.com/chatmail/core.git
synced 2026-04-25 09:26:30 +03:00
Derive Default where possible
This commit is contained in:
@@ -11,20 +11,15 @@ use anyhow::{bail, Context as _, Error, Result};
|
||||
use crate::key::{DcKey, SignedPublicKey};
|
||||
|
||||
/// Possible values for encryption preference
|
||||
#[derive(PartialEq, Eq, Debug, Clone, Copy, FromPrimitive, ToPrimitive)]
|
||||
#[derive(PartialEq, Eq, Debug, Default, Clone, Copy, FromPrimitive, ToPrimitive)]
|
||||
#[repr(u8)]
|
||||
pub enum EncryptPreference {
|
||||
#[default]
|
||||
NoPreference = 0,
|
||||
Mutual = 1,
|
||||
Reset = 20,
|
||||
}
|
||||
|
||||
impl Default for EncryptPreference {
|
||||
fn default() -> Self {
|
||||
EncryptPreference::NoPreference
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for EncryptPreference {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
|
||||
Reference in New Issue
Block a user