mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 00:59:22 -05:00
chore: latest clippy
This commit is contained in:
parent
f136be643c
commit
76facdedaa
2 changed files with 29 additions and 29 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::{UseDocument, UseWindow};
|
||||
use cfg_if::cfg_if;
|
||||
use leptos::html::{ElementDescriptor, HtmlElement};
|
||||
use leptos::html::ElementDescriptor;
|
||||
use leptos::*;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::Deref;
|
||||
|
@ -13,7 +13,7 @@ use std::ops::Deref;
|
|||
/// * a `NodeRef`
|
||||
/// into a function. Used for example in [`use_event_listener`].
|
||||
pub enum ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
Static(Option<T>),
|
||||
|
@ -22,7 +22,7 @@ where
|
|||
}
|
||||
|
||||
impl<T, E> Default for ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
fn default() -> Self {
|
||||
|
@ -31,7 +31,7 @@ where
|
|||
}
|
||||
|
||||
impl<T, E> Clone for ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
fn clone(&self) -> Self {
|
||||
|
@ -44,7 +44,7 @@ where
|
|||
}
|
||||
|
||||
impl<T, E> SignalGet for ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
type Value = Option<T>;
|
||||
|
@ -67,7 +67,7 @@ where
|
|||
}
|
||||
|
||||
impl<T, E> SignalWith for ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
type Value = Option<T>;
|
||||
|
@ -90,7 +90,7 @@ where
|
|||
}
|
||||
|
||||
impl<T, E> SignalWithUntracked for ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
type Value = Option<T>;
|
||||
|
@ -113,7 +113,7 @@ where
|
|||
}
|
||||
|
||||
impl<T, E> SignalGetUntracked for ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
type Value = Option<T>;
|
||||
|
@ -138,7 +138,7 @@ where
|
|||
// From static element //////////////////////////////////////////////////////////////
|
||||
|
||||
impl<T, E> From<T> for ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
fn from(value: T) -> Self {
|
||||
|
@ -147,7 +147,7 @@ where
|
|||
}
|
||||
|
||||
impl<T, E> From<Option<T>> for ElementMaybeSignal<T, E>
|
||||
where
|
||||
where
|
||||
T: Into<E> + Clone + 'static,
|
||||
{
|
||||
fn from(target: Option<T>) -> Self {
|
||||
|
@ -174,7 +174,7 @@ impl_from_deref_option!(UseDocument, web_sys::Document);
|
|||
// From string (selector) ///////////////////////////////////////////////////////////////
|
||||
|
||||
impl<'a, E> From<&'a str> for ElementMaybeSignal<web_sys::Element, E>
|
||||
where
|
||||
where
|
||||
E: From<web_sys::Element> + 'static,
|
||||
{
|
||||
fn from(target: &'a str) -> Self {
|
||||
|
@ -188,7 +188,7 @@ where
|
|||
}
|
||||
|
||||
impl<E> From<String> for ElementMaybeSignal<web_sys::Element, E>
|
||||
where
|
||||
where
|
||||
E: From<web_sys::Element> + 'static,
|
||||
{
|
||||
fn from(target: String) -> Self {
|
||||
|
|
|
@ -9,7 +9,7 @@ use std::time::Duration;
|
|||
use crate::core::ConnectionReadyState;
|
||||
use default_struct_builder::DefaultBuilder;
|
||||
use js_sys::Array;
|
||||
use wasm_bindgen::{prelude::*, JsCast, JsValue};
|
||||
use wasm_bindgen::prelude::*;
|
||||
use web_sys::{BinaryType, CloseEvent, Event, MessageEvent, WebSocket};
|
||||
|
||||
/// Creating and managing a [Websocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) connection.
|
||||
|
@ -508,7 +508,7 @@ impl Default for UseWebSocketOptions {
|
|||
/// Return type of [`use_websocket`].
|
||||
#[derive(Clone)]
|
||||
pub struct UseWebsocketReturn<OpenFn, CloseFn, SendFn, SendBytesFn>
|
||||
where
|
||||
where
|
||||
OpenFn: Fn() + Clone + 'static,
|
||||
CloseFn: Fn() + Clone + 'static,
|
||||
SendFn: Fn(&str) + Clone + 'static,
|
||||
|
|
Loading…
Add table
Reference in a new issue