From 4ac23d864965b4082890b201788e26e7a936350d Mon Sep 17 00:00:00 2001 From: timedout Date: Sun, 1 Nov 2026 05:15:17 +0000 Subject: [PATCH] feat: Remove unused test commands --- src/admin/debug/mod.rs | 8 ------- src/admin/debug/tester.rs | 48 --------------------------------------- 2 files changed, 56 deletions(-) delete mode 100644 src/admin/debug/tester.rs diff --git a/src/admin/debug/mod.rs b/src/admin/debug/mod.rs index db9638d44..5dc09bb02 100644 --- a/src/admin/debug/mod.rs +++ b/src/admin/debug/mod.rs @@ -1,11 +1,9 @@ mod commands; -pub(crate) mod tester; use clap::Subcommand; use conduwuit::Result; use ruma::OwnedServerName; -use self::tester::TesterCommand; use crate::admin_command_dispatch; #[admin_command_dispatch] @@ -69,10 +67,4 @@ pub enum DebugCommand { RoomsByExtremityCount { page: Option, }, - - /// Developer test stubs - #[command(subcommand)] - #[allow(non_snake_case)] - #[clap(hide(true))] - Tester(TesterCommand), } diff --git a/src/admin/debug/tester.rs b/src/admin/debug/tester.rs deleted file mode 100644 index 9c1b57e06..000000000 --- a/src/admin/debug/tester.rs +++ /dev/null @@ -1,48 +0,0 @@ -use conduwuit::{Err, Result}; - -use crate::admin_command_dispatch; - -#[admin_command_dispatch] -#[derive(Debug, clap::Subcommand)] -pub enum TesterCommand { - Panic, - Failure, - Tester, - Timer, -} - -#[allow(clippy::unused_async_trait_impl)] -impl crate::Context<'_> { - #[rustfmt::skip] - async fn panic(&self) -> Result { - panic!("panicked") - } - - #[rustfmt::skip] - async fn failure(&self) -> Result { - Err!("failed") - } - - #[inline(never)] - #[rustfmt::skip] - async fn tester(&self) -> Result { - self.write_str("Ok").await - } - - #[inline(never)] - #[rustfmt::skip] - async fn timer(&self) -> Result { - let started = std::time::Instant::now(); - timed(self.body); - - let elapsed = started.elapsed(); - self.write_str(&format!("completed in {elapsed:#?}")).await - } -} - -#[inline(never)] -#[rustfmt::skip] -#[allow(unused_variables)] -fn timed(body: &[&str]) { - -}