From 9842173b26aa70267b528d724753bf781de3b634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABlle=20Huisman?= Date: Tue, 19 Aug 2025 09:36:03 +0200 Subject: [PATCH] refactor(dioxus): use `unreachable` for actions without server feature --- .../shield-dioxus/src/routes/action.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/integrations/shield-dioxus/src/routes/action.rs b/packages/integrations/shield-dioxus/src/routes/action.rs index 52a1c3d..01173a3 100644 --- a/packages/integrations/shield-dioxus/src/routes/action.rs +++ b/packages/integrations/shield-dioxus/src/routes/action.rs @@ -28,6 +28,7 @@ pub fn Action(props: ActionProps) -> Element { // TODO: Figure out a way to access `FromContext` and `extract` without `dioxus/server` feature. +#[cfg_attr(not(feature = "server"), allow(unused_variables))] #[server] async fn forms(action_id: String) -> Result { #[cfg(feature = "server")] @@ -46,13 +47,7 @@ async fn forms(action_id: String) -> Result { } #[cfg(not(feature = "server"))] - { - Ok(ActionForms { - id: action_id.clone(), - name: action_id, - forms: vec![], - }) - } + unreachable!() } #[cfg_attr(not(feature = "server"), allow(unused_variables))] @@ -87,7 +82,10 @@ pub async fn call( }, ) .await?; + + Ok(()) } - Ok(()) + #[cfg(not(feature = "server"))] + unreachable!() }