fix: maybe_misused_cfg

This commit is contained in:
Joseph Cruz 2023-07-18 17:48:41 -04:00
parent a344804734
commit 3af115a663
5 changed files with 35 additions and 35 deletions

View file

@ -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)]

View file

@ -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<S>,
pub(crate) out_ty: PhantomData<T>,
#[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,
}
}

View file

@ -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)]

View file

@ -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<T>(
@ -69,7 +69,7 @@ pub fn run_scope<T>(
///
/// 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<T>(
@ -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<dyn FnOnce()>) {
@ -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<ResourceId> {
@ -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<ResourceId> {
@ -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<String, FragmentData> {
@ -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<FragmentData> {
@ -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)]

View file

@ -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<Vec<Submission<I, O>>> {
@ -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<usize> {
@ -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<T: ServerFn>(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<I, O, F, Fu>(
@ -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<S>(