mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-22 16:49:22 -05:00
Run cargo clippy
This commit is contained in:
parent
60d43f6317
commit
6001a93142
10 changed files with 14 additions and 11 deletions
|
@ -6,11 +6,13 @@ use std::marker::PhantomData;
|
|||
use std::ops::Deref;
|
||||
|
||||
/// Used as an argument type to make it easily possible to pass either
|
||||
///
|
||||
/// * a `web_sys` element that implements `E` (for example `EventTarget`, `Element` or `HtmlElement`),
|
||||
/// * an `Option<T>` where `T` is the web_sys element,
|
||||
/// * a `Signal<T>` where `T` is the web_sys element,
|
||||
/// * a `Signal<Option<T>>` where `T` is the web_sys element,
|
||||
/// * a `NodeRef`
|
||||
///
|
||||
/// into a function. Used for example in [`fn@crate::use_event_listener`].
|
||||
pub enum ElementMaybeSignal<T, E>
|
||||
where
|
||||
|
|
|
@ -7,11 +7,13 @@ use std::marker::PhantomData;
|
|||
use std::ops::Deref;
|
||||
|
||||
/// Used as an argument type to make it easily possible to pass either
|
||||
///
|
||||
/// * a `web_sys` element that implements `E` (for example `EventTarget` or `Element`),
|
||||
/// * an `Option<T>` where `T` is the web_sys element,
|
||||
/// * a `Signal<T>` where `T` is the web_sys element,
|
||||
/// * a `Signal<Option<T>>` where `T` is the web_sys element,
|
||||
/// * a `NodeRef`
|
||||
///
|
||||
/// into a function. Used for example in [`fn@crate::use_event_listener`].
|
||||
pub enum ElementsMaybeSignal<T, E>
|
||||
where
|
||||
|
|
|
@ -45,9 +45,9 @@ cfg_if! { if #[cfg(not(feature = "ssr"))] {
|
|||
/// ```
|
||||
///
|
||||
/// > This function uses [Event.composedPath()](https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath)
|
||||
/// which is **not** supported by IE 11, Edge 18 and below.
|
||||
/// If you are targeting these browsers, we recommend you to include
|
||||
/// [this code snippet](https://gist.github.com/sibbng/13e83b1dd1b733317ce0130ef07d4efd) on your project.
|
||||
/// > which is **not** supported by IE 11, Edge 18 and below.
|
||||
/// > If you are targeting these browsers, we recommend you to include
|
||||
/// > [this code snippet](https://gist.github.com/sibbng/13e83b1dd1b733317ce0130ef07d4efd) on your project.
|
||||
///
|
||||
/// ## Excluding Elements
|
||||
///
|
||||
|
|
|
@ -31,7 +31,7 @@ const INTERNAL_STORAGE_EVENT: &str = "leptos-use-storage";
|
|||
/// binary codec wrapped in `Base64`.
|
||||
///
|
||||
/// > Please check [the codec chapter](https://leptos-use.rs/codecs.html) to see what codecs are
|
||||
/// available and what feature flags they require.
|
||||
/// > available and what feature flags they require.
|
||||
///
|
||||
/// ## Example
|
||||
///
|
||||
|
|
|
@ -48,7 +48,7 @@ use wasm_bindgen::JsValue;
|
|||
/// binary codec wrapped in `Base64`.
|
||||
///
|
||||
/// > Please check [the codec chapter](https://leptos-use.rs/codecs.html) to see what codecs are
|
||||
/// available and what feature flags they require.
|
||||
/// > available and what feature flags they require.
|
||||
///
|
||||
/// ```
|
||||
/// # use leptos::*;
|
||||
|
|
|
@ -426,7 +426,7 @@ where
|
|||
/// To get the default behaviour back you can call the provided `default_handler` function.
|
||||
/// It takes two parameters:
|
||||
/// - `mode: ColorMode`: The color mode to change to.
|
||||
/// -`default_handler: Rc<dyn Fn(ColorMode)>`: The default handler that would have been called if the `on_changed` handler had not been specified.
|
||||
/// - `default_handler: Rc<dyn Fn(ColorMode)>`: The default handler that would have been called if the `on_changed` handler had not been specified.
|
||||
on_changed: OnChangedFn,
|
||||
|
||||
/// When provided, `useStorage` will be skipped.
|
||||
|
|
|
@ -60,7 +60,7 @@ use std::rc::Rc;
|
|||
/// binary codec wrapped in `Base64`.
|
||||
///
|
||||
/// > Please check [the codec chapter](https://leptos-use.rs/codecs.html) to see what codecs are
|
||||
/// available and what feature flags they require.
|
||||
/// > available and what feature flags they require.
|
||||
///
|
||||
/// ## Cookie attributes
|
||||
///
|
||||
|
|
|
@ -22,7 +22,7 @@ use thiserror::Error;
|
|||
/// binary codec wrapped in `Base64`.
|
||||
///
|
||||
/// > Please check [the codec chapter](https://leptos-use.rs/codecs.html) to see what codecs are
|
||||
/// available and what feature flags they require.
|
||||
/// > available and what feature flags they require.
|
||||
///
|
||||
///
|
||||
/// ```
|
||||
|
|
|
@ -28,7 +28,7 @@ use web_sys::{BinaryType, CloseEvent, Event, MessageEvent, WebSocket};
|
|||
/// Values are (en)decoded via the given codec. You can use any of the codecs, string or binary.
|
||||
///
|
||||
/// > Please check [the codec chapter](https://leptos-use.rs/codecs.html) to see what codecs are
|
||||
/// available and what feature flags they require.
|
||||
/// > available and what feature flags they require.
|
||||
///
|
||||
/// ```
|
||||
/// # use leptos::*;
|
||||
|
@ -248,6 +248,7 @@ where
|
|||
}
|
||||
|
||||
/// Version of [`use_websocket`] that takes `UseWebSocketOptions`. See [`use_websocket`] for how to use.
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub fn use_websocket_with_options<T, C>(
|
||||
url: &str,
|
||||
options: UseWebSocketOptions<
|
||||
|
|
|
@ -89,8 +89,6 @@ use std::rc::Rc;
|
|||
///
|
||||
/// * [`fn@crate::watch_throttled`]
|
||||
/// * [`fn@crate::watch_debounced`]
|
||||
|
||||
/// Version of `watch` that accepts `WatchOptions`. See [`watch`] for how to use.
|
||||
pub fn watch_with_options<W, T, DFn, CFn>(
|
||||
deps: DFn,
|
||||
callback: CFn,
|
||||
|
|
Loading…
Add table
Reference in a new issue