diff --git a/server_fn/src/error.rs b/server_fn/src/error.rs index 5352a8d598..fa84d9128c 100644 --- a/server_fn/src/error.rs +++ b/server_fn/src/error.rs @@ -10,7 +10,7 @@ use thiserror::Error; use url::Url; /// A custom header that can be used to indicate a server function returned an error. -pub const SERVER_FN_ERROR_HEADER: &'static str = "serverfnerror"; +pub const SERVER_FN_ERROR_HEADER: &str = "serverfnerror"; /// This is a result type into which any error can be converted, /// and which can be used directly in your `view`. diff --git a/server_fn/src/lib.rs b/server_fn/src/lib.rs index d8cb5a4919..b51506b3af 100644 --- a/server_fn/src/lib.rs +++ b/server_fn/src/lib.rs @@ -125,7 +125,9 @@ use codec::{Encoding, FromReq, FromRes, IntoReq, IntoRes}; pub use const_format; use dashmap::DashMap; pub use error::ServerFnError; -use error::{ServerFnErrorSerde, ServerFnUrlError}; +use error::ServerFnErrorSerde; +#[cfg(feature = "form-redirects")] +use error::ServerFnUrlError; use http::Method; use middleware::{Layer, Service}; use once_cell::sync::Lazy; @@ -240,16 +242,17 @@ where // Server functions can either be called by a real Client, // or directly by an HTML