From edd52c4322616c11f437fd7d69f6f89b28344136 Mon Sep 17 00:00:00 2001 From: Kayh Date: Sat, 18 Nov 2023 12:37:27 -0500 Subject: [PATCH] remove cfg-if --- Cargo.lock | 2 -- app/Cargo.toml | 1 - flake.nix | 2 -- web/app/Cargo.toml | 1 - web/app/src/error_template.rs | 6 +++--- 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2fc429ebf..384e22d44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4902,7 +4902,6 @@ dependencies = [ "bevy", "bevy_rapier3d", "bevy_vrm", - "cfg-if", "tracing", ] @@ -4930,7 +4929,6 @@ dependencies = [ name = "unavi-web-app" version = "0.0.0" dependencies = [ - "cfg-if", "http", "leptos", "leptos_axum", diff --git a/app/Cargo.toml b/app/Cargo.toml index d67f087eb..7aa8d965b 100644 --- a/app/Cargo.toml +++ b/app/Cargo.toml @@ -9,5 +9,4 @@ edition.workspace = true bevy = "0.12.0" bevy_rapier3d = { version = "0.23.0", features = ["simd-stable"] } bevy_vrm = "0.0.5" -cfg-if = "1.0.0" tracing = "0.1.40" diff --git a/flake.nix b/flake.nix index 5f2111b94..37fc6e267 100644 --- a/flake.nix +++ b/flake.nix @@ -29,10 +29,8 @@ alsa-lib udev vulkan-loader - libxkbcommon wayland - xorg.libX11 xorg.libXcursor xorg.libXi diff --git a/web/app/Cargo.toml b/web/app/Cargo.toml index cfecc8105..e72a32771 100644 --- a/web/app/Cargo.toml +++ b/web/app/Cargo.toml @@ -6,7 +6,6 @@ repository.workspace = true edition.workspace = true [dependencies] -cfg-if = "1.0.0" http = "0.2.9" leptos = "0.5.1" leptos_axum = { version = "0.5.1", optional = true } diff --git a/web/app/src/error_template.rs b/web/app/src/error_template.rs index e5d5e1cee..172a173d9 100644 --- a/web/app/src/error_template.rs +++ b/web/app/src/error_template.rs @@ -1,4 +1,3 @@ -use cfg_if::cfg_if; use http::status::StatusCode; use leptos::*; use thiserror::Error; @@ -46,12 +45,13 @@ pub fn ErrorTemplate( // Only the response code for the first error is actually sent from the server // this may be customized by the specific application - cfg_if! { if #[cfg(feature="ssr")] { + #[cfg(feature = "ssr")] + { let response = use_context::(); if let Some(response) = response { response.set_status(errors[0].status_code()); } - }} + } view! {

{if errors.len() > 1 {"Errors"} else {"Error"}}