Derive Default where possible

This commit is contained in:
link2xt
2023-02-14 20:54:16 +00:00
parent e11d7c0444
commit 05f0fe0a88
11 changed files with 47 additions and 121 deletions

View File

@@ -61,6 +61,7 @@ pub enum ChatItem {
/// Chat protection status.
#[derive(
Debug,
Default,
Display,
Clone,
Copy,
@@ -77,6 +78,7 @@ pub enum ChatItem {
#[repr(u32)]
pub enum ProtectionStatus {
/// Chat is not protected.
#[default]
Unprotected = 0,
/// Chat is protected.
@@ -85,12 +87,6 @@ pub enum ProtectionStatus {
Protected = 1,
}
impl Default for ProtectionStatus {
fn default() -> Self {
ProtectionStatus::Unprotected
}
}
/// The reason why messages cannot be sent to the chat.
///
/// The reason is mainly for logging and displaying in debug REPL, thus not translated.