From 325531d13ff2b6ce8ea8ea24986cc61b3522ffdd Mon Sep 17 00:00:00 2001 From: Johannes Becker Date: Mon, 10 May 2021 09:04:51 +0200 Subject: [PATCH] appservice: Compile time webserver feature check --- matrix_sdk_appservice/src/lib.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/matrix_sdk_appservice/src/lib.rs b/matrix_sdk_appservice/src/lib.rs index 946a7ec9..8c27376f 100644 --- a/matrix_sdk_appservice/src/lib.rs +++ b/matrix_sdk_appservice/src/lib.rs @@ -51,6 +51,9 @@ //! //! [Application Service]: https://matrix.org/docs/spec/application_service/r0.1.2 +#[cfg(not(any(feature = "actix",)))] +compile_error!("one webserver feature must be enabled. available ones: `actix`"); + use std::{ convert::{TryFrom, TryInto}, fs::File, @@ -322,14 +325,7 @@ impl Appservice { Ok(()) } - #[cfg(not(feature = "actix"))] - { - error!( - "tried to bind {}:{} but no server feature activated", - host.as_ref(), - port.into() - ); - unimplemented!(); - } + #[cfg(not(any(feature = "actix",)))] + unreachable!() } }