mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 00:59:22 -05:00
chore: latest rustfmt
This commit is contained in:
parent
76facdedaa
commit
446b10b1cf
2 changed files with 27 additions and 27 deletions
|
@ -13,8 +13,8 @@ use std::ops::Deref;
|
||||||
/// * a `NodeRef`
|
/// * a `NodeRef`
|
||||||
/// into a function. Used for example in [`use_event_listener`].
|
/// into a function. Used for example in [`use_event_listener`].
|
||||||
pub enum ElementMaybeSignal<T, E>
|
pub enum ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
Static(Option<T>),
|
Static(Option<T>),
|
||||||
Dynamic(Signal<Option<T>>),
|
Dynamic(Signal<Option<T>>),
|
||||||
|
@ -22,8 +22,8 @@ pub enum ElementMaybeSignal<T, E>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E> Default for ElementMaybeSignal<T, E>
|
impl<T, E> Default for ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self::Static(None)
|
Self::Static(None)
|
||||||
|
@ -31,8 +31,8 @@ impl<T, E> Default for ElementMaybeSignal<T, E>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E> Clone for ElementMaybeSignal<T, E>
|
impl<T, E> Clone for ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
match self {
|
match self {
|
||||||
|
@ -44,8 +44,8 @@ impl<T, E> Clone for ElementMaybeSignal<T, E>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E> SignalGet for ElementMaybeSignal<T, E>
|
impl<T, E> SignalGet for ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
type Value = Option<T>;
|
type Value = Option<T>;
|
||||||
|
|
||||||
|
@ -67,8 +67,8 @@ impl<T, E> SignalGet for ElementMaybeSignal<T, E>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E> SignalWith for ElementMaybeSignal<T, E>
|
impl<T, E> SignalWith for ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
type Value = Option<T>;
|
type Value = Option<T>;
|
||||||
|
|
||||||
|
@ -90,8 +90,8 @@ impl<T, E> SignalWith for ElementMaybeSignal<T, E>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E> SignalWithUntracked for ElementMaybeSignal<T, E>
|
impl<T, E> SignalWithUntracked for ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
type Value = Option<T>;
|
type Value = Option<T>;
|
||||||
|
|
||||||
|
@ -113,8 +113,8 @@ impl<T, E> SignalWithUntracked for ElementMaybeSignal<T, E>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E> SignalGetUntracked for ElementMaybeSignal<T, E>
|
impl<T, E> SignalGetUntracked for ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
type Value = Option<T>;
|
type Value = Option<T>;
|
||||||
|
|
||||||
|
@ -138,8 +138,8 @@ impl<T, E> SignalGetUntracked for ElementMaybeSignal<T, E>
|
||||||
// From static element //////////////////////////////////////////////////////////////
|
// From static element //////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
impl<T, E> From<T> for ElementMaybeSignal<T, E>
|
impl<T, E> From<T> for ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
fn from(value: T) -> Self {
|
fn from(value: T) -> Self {
|
||||||
ElementMaybeSignal::Static(Some(value))
|
ElementMaybeSignal::Static(Some(value))
|
||||||
|
@ -147,8 +147,8 @@ impl<T, E> From<T> for ElementMaybeSignal<T, E>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E> From<Option<T>> for ElementMaybeSignal<T, E>
|
impl<T, E> From<Option<T>> for ElementMaybeSignal<T, E>
|
||||||
where
|
where
|
||||||
T: Into<E> + Clone + 'static,
|
T: Into<E> + Clone + 'static,
|
||||||
{
|
{
|
||||||
fn from(target: Option<T>) -> Self {
|
fn from(target: Option<T>) -> Self {
|
||||||
ElementMaybeSignal::Static(target)
|
ElementMaybeSignal::Static(target)
|
||||||
|
@ -174,8 +174,8 @@ impl_from_deref_option!(UseDocument, web_sys::Document);
|
||||||
// From string (selector) ///////////////////////////////////////////////////////////////
|
// From string (selector) ///////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
impl<'a, E> From<&'a str> for ElementMaybeSignal<web_sys::Element, E>
|
impl<'a, E> From<&'a str> for ElementMaybeSignal<web_sys::Element, E>
|
||||||
where
|
where
|
||||||
E: From<web_sys::Element> + 'static,
|
E: From<web_sys::Element> + 'static,
|
||||||
{
|
{
|
||||||
fn from(target: &'a str) -> Self {
|
fn from(target: &'a str) -> Self {
|
||||||
cfg_if! { if #[cfg(feature = "ssr")] {
|
cfg_if! { if #[cfg(feature = "ssr")] {
|
||||||
|
@ -188,8 +188,8 @@ impl<'a, E> From<&'a str> for ElementMaybeSignal<web_sys::Element, E>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<E> From<String> for ElementMaybeSignal<web_sys::Element, E>
|
impl<E> From<String> for ElementMaybeSignal<web_sys::Element, E>
|
||||||
where
|
where
|
||||||
E: From<web_sys::Element> + 'static,
|
E: From<web_sys::Element> + 'static,
|
||||||
{
|
{
|
||||||
fn from(target: String) -> Self {
|
fn from(target: String) -> Self {
|
||||||
Self::from(target.as_str())
|
Self::from(target.as_str())
|
||||||
|
|
|
@ -508,11 +508,11 @@ impl Default for UseWebSocketOptions {
|
||||||
/// Return type of [`use_websocket`].
|
/// Return type of [`use_websocket`].
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct UseWebsocketReturn<OpenFn, CloseFn, SendFn, SendBytesFn>
|
pub struct UseWebsocketReturn<OpenFn, CloseFn, SendFn, SendBytesFn>
|
||||||
where
|
where
|
||||||
OpenFn: Fn() + Clone + 'static,
|
OpenFn: Fn() + Clone + 'static,
|
||||||
CloseFn: Fn() + Clone + 'static,
|
CloseFn: Fn() + Clone + 'static,
|
||||||
SendFn: Fn(&str) + Clone + 'static,
|
SendFn: Fn(&str) + Clone + 'static,
|
||||||
SendBytesFn: Fn(Vec<u8>) + Clone + 'static,
|
SendBytesFn: Fn(Vec<u8>) + Clone + 'static,
|
||||||
{
|
{
|
||||||
/// The current state of the `WebSocket` connection.
|
/// The current state of the `WebSocket` connection.
|
||||||
pub ready_state: Signal<ConnectionReadyState>,
|
pub ready_state: Signal<ConnectionReadyState>,
|
||||||
|
|
Loading…
Add table
Reference in a new issue