From 3af115a66344e4d40963e885a2fb01cecafa2a3a Mon Sep 17 00:00:00 2001 From: Joseph Cruz Date: Tue, 18 Jul 2023 17:48:41 -0400 Subject: [PATCH] fix: maybe_misused_cfg --- leptos_dom/src/helpers.rs | 8 +++---- leptos_reactive/src/resource.rs | 8 +++---- leptos_reactive/src/runtime.rs | 2 +- leptos_reactive/src/scope.rs | 38 +++++++++++++++---------------- leptos_server/src/multi_action.rs | 14 ++++++------ 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/leptos_dom/src/helpers.rs b/leptos_dom/src/helpers.rs index e15c7c178..a99af187a 100644 --- a/leptos_dom/src/helpers.rs +++ b/leptos_dom/src/helpers.rs @@ -196,7 +196,7 @@ impl TimeoutHandle { /// Executes the given function after the given duration of time has passed. /// [`setTimeout()`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout). #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all, fields(duration = ?duration)) )] pub fn set_timeout(cb: impl FnOnce() + 'static, duration: Duration) { @@ -206,7 +206,7 @@ pub fn set_timeout(cb: impl FnOnce() + 'static, duration: Duration) { /// Executes the given function after the given duration of time has passed, returning a cancelable handle. /// [`setTimeout()`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout). #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all, fields(duration = ?duration)) )] #[inline(always)] @@ -329,7 +329,7 @@ impl IntervalHandle { /// returning a cancelable handle. /// See [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval). #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all, fields(duration = ?duration)) )] pub fn set_interval(cb: impl Fn() + 'static, duration: Duration) { @@ -340,7 +340,7 @@ pub fn set_interval(cb: impl Fn() + 'static, duration: Duration) { /// returning a cancelable handle. /// See [`setInterval()`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval). #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all, fields(duration = ?duration)) )] #[inline(always)] diff --git a/leptos_reactive/src/resource.rs b/leptos_reactive/src/resource.rs index 80d7aa7d2..cd6503c0e 100644 --- a/leptos_reactive/src/resource.rs +++ b/leptos_reactive/src/resource.rs @@ -237,7 +237,7 @@ where id, source_ty: PhantomData, out_ty: PhantomData, - #[cfg(any(debug_assertions, features = "ssr"))] + #[cfg(any(debug_assertions, feature = "ssr"))] defined_at: std::panic::Location::caller(), } } @@ -373,7 +373,7 @@ where id, source_ty: PhantomData, out_ty: PhantomData, - #[cfg(any(debug_assertions, features = "ssr"))] + #[cfg(any(debug_assertions, feature = "ssr"))] defined_at: std::panic::Location::caller(), } } @@ -719,7 +719,7 @@ where pub(crate) id: ResourceId, pub(crate) source_ty: PhantomData, pub(crate) out_ty: PhantomData, - #[cfg(any(debug_assertions, features = "ssr"))] + #[cfg(any(debug_assertions, feature = "ssr"))] pub(crate) defined_at: &'static std::panic::Location<'static>, } @@ -744,7 +744,7 @@ where id: self.id, source_ty: PhantomData, out_ty: PhantomData, - #[cfg(any(debug_assertions, features = "ssr"))] + #[cfg(any(debug_assertions, feature = "ssr"))] defined_at: self.defined_at, } } diff --git a/leptos_reactive/src/runtime.rs b/leptos_reactive/src/runtime.rs index 9750f304f..dfc6f2b7f 100644 --- a/leptos_reactive/src/runtime.rs +++ b/leptos_reactive/src/runtime.rs @@ -475,7 +475,7 @@ impl RuntimeId { } #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] #[inline(always)] diff --git a/leptos_reactive/src/scope.rs b/leptos_reactive/src/scope.rs index 71dcddfc3..4662f8eb8 100644 --- a/leptos_reactive/src/scope.rs +++ b/leptos_reactive/src/scope.rs @@ -37,7 +37,7 @@ pub fn create_scope( /// /// You usually don't need to call this manually. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn raw_scope_and_disposer(runtime: RuntimeId) -> (Scope, ScopeDisposer) { @@ -52,7 +52,7 @@ pub fn raw_scope_and_disposer(runtime: RuntimeId) -> (Scope, ScopeDisposer) { /// /// You usually don't need to call this manually. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn run_scope( @@ -69,7 +69,7 @@ pub fn run_scope( /// /// You usually don't need to call this manually. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn run_scope_undisposed( @@ -128,7 +128,7 @@ impl Scope { /// dispose of them when they are no longer needed (e.g., a list item has been destroyed or the user /// has navigated away from the route.) #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] #[inline(always)] @@ -147,7 +147,7 @@ impl Scope { /// dispose of them when they are no longer needed (e.g., a list item has been destroyed or the user /// has navigated away from the route.) #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] #[inline(always)] @@ -203,7 +203,7 @@ impl Scope { /// # }); /// ``` #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] #[inline(always)] @@ -229,7 +229,7 @@ impl Scope { /// 2. run all cleanup functions defined for this scope by [`on_cleanup`](crate::on_cleanup). /// 3. dispose of all signals, effects, and resources owned by this `Scope`. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn dispose(self) { @@ -306,7 +306,7 @@ impl Scope { }) } #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub(crate) fn push_scope_property(&self, prop: ScopeProperty) { @@ -322,7 +322,7 @@ impl Scope { }) } #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub(crate) fn remove_scope_property(&self, prop: ScopeProperty) { @@ -343,7 +343,7 @@ impl Scope { }) } #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] /// Returns the the parent Scope, if any. @@ -361,7 +361,7 @@ impl Scope { } #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] fn push_cleanup(cx: Scope, cleanup_fn: Box) { @@ -424,7 +424,7 @@ impl ScopeDisposer { impl Scope { /// Returns IDs for all [`Resource`](crate::Resource)s found on any scope. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn all_resources(&self) -> Vec { @@ -435,7 +435,7 @@ impl Scope { /// Returns IDs for all [`Resource`](crate::Resource)s found on any scope that are /// pending from the server. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn pending_resources(&self) -> Vec { @@ -445,7 +445,7 @@ impl Scope { /// Returns IDs for all [`Resource`](crate::Resource)s found on any scope. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn serialization_resolvers( @@ -460,7 +460,7 @@ impl Scope { /// Registers the given [`SuspenseContext`](crate::SuspenseContext) with the current scope, /// calling the `resolver` when its resources are all resolved. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn register_suspense( @@ -517,7 +517,7 @@ impl Scope { /// The keys are hydration IDs. Values are tuples of two pinned /// `Future`s that return content for out-of-order and in-order streaming, respectively. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn pending_fragments(&self) -> HashMap { @@ -530,7 +530,7 @@ impl Scope { /// A future that will resolve when all blocking fragments are ready. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn blocking_fragments_ready(self) -> PinnedFuture<()> { @@ -557,7 +557,7 @@ impl Scope { /// Returns a tuple of two pinned `Future`s that return content for out-of-order /// and in-order streaming, respectively. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] pub fn take_pending_fragment(&self, id: &str) -> Option { @@ -576,7 +576,7 @@ impl Scope { /// # Panics /// Panics if the runtime this scope belongs to has already been disposed. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), instrument(level = "trace", skip_all,) )] #[inline(always)] diff --git a/leptos_server/src/multi_action.rs b/leptos_server/src/multi_action.rs index bd47f46bb..4e5eed2c2 100644 --- a/leptos_server/src/multi_action.rs +++ b/leptos_server/src/multi_action.rs @@ -95,7 +95,7 @@ where { /// Calls the `async` function with a reference to the input type as its argument. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), tracing::instrument(level = "trace", skip_all,) )] pub fn dispatch(&self, input: I) { @@ -104,7 +104,7 @@ where /// The set of all submissions to this multi-action. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), tracing::instrument(level = "trace", skip_all,) )] pub fn submissions(&self) -> ReadSignal>> { @@ -119,7 +119,7 @@ where /// How many times an action has successfully resolved. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), tracing::instrument(level = "trace", skip_all,) )] pub fn version(&self) -> RwSignal { @@ -129,7 +129,7 @@ where /// Associates the URL of the given server function with this action. /// This enables integration with the `MultiActionForm` component in `leptos_router`. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), tracing::instrument(level = "trace", skip_all,) )] pub fn using_server_fn(self) -> Self { @@ -212,7 +212,7 @@ where { /// Calls the `async` function with a reference to the input type as its argument. #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), tracing::instrument(level = "trace", skip_all,) )] pub fn dispatch(&self, input: I) { @@ -304,7 +304,7 @@ where /// # }); /// ``` #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), tracing::instrument(level = "trace", skip_all,) )] pub fn create_multi_action( @@ -351,7 +351,7 @@ where /// # }); /// ``` #[cfg_attr( - any(debug_assertions, features = "ssr"), + any(debug_assertions, feature = "ssr"), tracing::instrument(level = "trace", skip_all,) )] pub fn create_server_multi_action(