diff --git a/src/admin/admin.rs b/src/admin/admin.rs index e55f6d61..f5fe5dc2 100644 --- a/src/admin/admin.rs +++ b/src/admin/admin.rs @@ -8,7 +8,7 @@ use crate::{ server, server::ServerCommand, user, user::UserCommand, }; -#[derive(Parser)] +#[derive(Debug, Parser)] #[command(name = "admin", version = env!("CARGO_PKG_VERSION"))] pub(crate) enum AdminCommand { #[command(subcommand)] diff --git a/src/admin/appservice/mod.rs b/src/admin/appservice/mod.rs index 87ab1b6d..81e04087 100644 --- a/src/admin/appservice/mod.rs +++ b/src/admin/appservice/mod.rs @@ -6,8 +6,7 @@ use ruma::events::room::message::RoomMessageEventContent; use self::commands::*; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum AppserviceCommand { /// - Register an appservice using its registration YAML /// diff --git a/src/admin/check/mod.rs b/src/admin/check/mod.rs index fdbe3d0d..f1cfa2b9 100644 --- a/src/admin/check/mod.rs +++ b/src/admin/check/mod.rs @@ -6,8 +6,7 @@ use ruma::events::room::message::RoomMessageEventContent; use self::commands::*; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum CheckCommand { AllUsers, } diff --git a/src/admin/debug/mod.rs b/src/admin/debug/mod.rs index 41527cf5..0df47748 100644 --- a/src/admin/debug/mod.rs +++ b/src/admin/debug/mod.rs @@ -8,8 +8,7 @@ use tester::TesterCommand; use self::commands::*; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum DebugCommand { /// - Echo input of admin command Echo { diff --git a/src/admin/debug/tester.rs b/src/admin/debug/tester.rs index 6982ef52..2765a344 100644 --- a/src/admin/debug/tester.rs +++ b/src/admin/debug/tester.rs @@ -2,8 +2,7 @@ use ruma::events::room::message::RoomMessageEventContent; use crate::Result; -#[derive(clap::Subcommand)] -#[cfg_attr(test, derive(Debug))] +#[derive(Debug, clap::Subcommand)] pub(crate) enum TesterCommand { Tester, Timer, diff --git a/src/admin/federation/mod.rs b/src/admin/federation/mod.rs index 46e323b2..d02b4295 100644 --- a/src/admin/federation/mod.rs +++ b/src/admin/federation/mod.rs @@ -6,8 +6,7 @@ use ruma::{events::room::message::RoomMessageEventContent, RoomId, ServerName, U use self::commands::*; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum FederationCommand { /// - List all rooms we are currently handling an incoming pdu from IncomingFederation, diff --git a/src/admin/media/mod.rs b/src/admin/media/mod.rs index 60f7a9bb..d30c55d0 100644 --- a/src/admin/media/mod.rs +++ b/src/admin/media/mod.rs @@ -6,8 +6,7 @@ use ruma::{events::room::message::RoomMessageEventContent, EventId, MxcUri}; use self::commands::*; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum MediaCommand { /// - Deletes a single media file from our database and on the filesystem /// via a single MXC URL diff --git a/src/admin/query/mod.rs b/src/admin/query/mod.rs index ea7036d0..c86f4f53 100644 --- a/src/admin/query/mod.rs +++ b/src/admin/query/mod.rs @@ -21,8 +21,7 @@ use self::{ room_alias::room_alias, sending::sending, users::users, }; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// Query tables from database pub(super) enum QueryCommand { /// - account_data.rs iterators and getters @@ -62,8 +61,7 @@ pub(super) enum QueryCommand { Resolver(Resolver), } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// All the getters and iterators from src/database/key_value/account_data.rs pub(super) enum AccountData { /// - Returns all changes to the account data that happened after `since`. @@ -87,8 +85,7 @@ pub(super) enum AccountData { }, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// All the getters and iterators from src/database/key_value/appservice.rs pub(super) enum Appservice { /// - Gets the appservice registration info/details from the ID as a string @@ -101,8 +98,7 @@ pub(super) enum Appservice { All, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// All the getters and iterators from src/database/key_value/presence.rs pub(super) enum Presence { /// - Returns the latest presence event for the given user. @@ -119,8 +115,7 @@ pub(super) enum Presence { }, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// All the getters and iterators from src/database/key_value/rooms/alias.rs pub(super) enum RoomAlias { ResolveLocalAlias { @@ -138,8 +133,7 @@ pub(super) enum RoomAlias { AllLocalAliases, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum RoomStateCache { ServerInRoom { server: Box, @@ -210,8 +204,7 @@ pub(super) enum RoomStateCache { }, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// All the getters and iterators from src/database/key_value/globals.rs pub(super) enum Globals { DatabaseVersion, @@ -229,8 +222,7 @@ pub(super) enum Globals { }, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// All the getters and iterators from src/database/key_value/sending.rs pub(super) enum Sending { /// - Queries database for all `servercurrentevent_data` @@ -285,15 +277,13 @@ pub(super) enum Sending { }, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// All the getters and iterators from src/database/key_value/users.rs pub(super) enum Users { Iter, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] /// Resolver service and caches pub(super) enum Resolver { /// Query the destinations cache diff --git a/src/admin/room/mod.rs b/src/admin/room/mod.rs index b4fa15bd..8f125f0a 100644 --- a/src/admin/room/mod.rs +++ b/src/admin/room/mod.rs @@ -10,8 +10,7 @@ use ruma::{events::room::message::RoomMessageEventContent, RoomId, RoomOrAliasId use self::room_commands::list; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum RoomCommand { /// - List all rooms the server knows about List { @@ -43,8 +42,7 @@ pub(super) enum RoomCommand { Directory(RoomDirectoryCommand), } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum RoomInfoCommand { /// - List joined members in a room ListJoinedMembers { @@ -60,8 +58,7 @@ pub(super) enum RoomInfoCommand { }, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum RoomAliasCommand { /// - Make an alias point to a room. Set { @@ -96,8 +93,7 @@ pub(super) enum RoomAliasCommand { }, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum RoomDirectoryCommand { /// - Publish a room to the room directory Publish { @@ -117,8 +113,7 @@ pub(super) enum RoomDirectoryCommand { }, } -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum RoomModerationCommand { /// - Bans a room from local users joining and evicts all our local users /// from the room. Also blocks any invites (local and remote) for the diff --git a/src/admin/server/mod.rs b/src/admin/server/mod.rs index 41b10180..604dacc7 100644 --- a/src/admin/server/mod.rs +++ b/src/admin/server/mod.rs @@ -6,8 +6,7 @@ use ruma::events::room::message::RoomMessageEventContent; use self::commands::*; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum ServerCommand { /// - Time elapsed since startup Uptime, diff --git a/src/admin/user/mod.rs b/src/admin/user/mod.rs index cdb5fa5e..1b92d668 100644 --- a/src/admin/user/mod.rs +++ b/src/admin/user/mod.rs @@ -6,8 +6,7 @@ use ruma::{events::room::message::RoomMessageEventContent, OwnedRoomOrAliasId, R use self::commands::*; -#[cfg_attr(test, derive(Debug))] -#[derive(Subcommand)] +#[derive(Debug, Subcommand)] pub(super) enum UserCommand { /// - Create a new user Create {