mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 05:46:29 +03:00
Derive Default where possible
This commit is contained in:
@@ -13,21 +13,16 @@ use crate::tools::{create_id, time};
|
||||
|
||||
/// Token namespace
|
||||
#[derive(
|
||||
Debug, Display, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive, ToSql, FromSql,
|
||||
Debug, Default, Display, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive, ToSql, FromSql,
|
||||
)]
|
||||
#[repr(u32)]
|
||||
pub enum Namespace {
|
||||
#[default]
|
||||
Unknown = 0,
|
||||
Auth = 110,
|
||||
InviteNumber = 100,
|
||||
}
|
||||
|
||||
impl Default for Namespace {
|
||||
fn default() -> Self {
|
||||
Namespace::Unknown
|
||||
}
|
||||
}
|
||||
|
||||
/// Saves a token to the database.
|
||||
pub async fn save(
|
||||
context: &Context,
|
||||
|
||||
Reference in New Issue
Block a user