From 701e3077fb776c1ff839ac7e21b251ce4bf62338 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Mon, 5 Feb 2024 06:38:02 -0500 Subject: [PATCH] chore: cargo fmt --- leptos_dom/src/html.rs | 2 +- router/src/lib.rs | 2 +- server_fn_macro/src/lib.rs | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/leptos_dom/src/html.rs b/leptos_dom/src/html.rs index 1473aeda0..1a65320b8 100644 --- a/leptos_dom/src/html.rs +++ b/leptos_dom/src/html.rs @@ -281,7 +281,7 @@ cfg_if! { /// When `El` has a corresponding [`web_sys::HtmlElement`] -> `El` will implement [`std::ops::Deref`] for it. /// For instance [`leptos::HtmlElement
`] implements [`std::ops::Deref`] for [`web_sys::HtmlDivElement`] /// Because of [Deref Coercion](https://doc.rust-lang.org/std/ops/trait.Deref.html#deref-coercion) you can call applicable [`web_sys::HtmlElement`] methods on `HtmlElement` as if it were that type. - /// If both `HtmlElement` and one of its derefs have a method with the same name, the dot syntax will call the method on the inherent impl (i.e. `HtmlElement` or it's [`std::ops::Deref`] Target). + /// If both `HtmlElement` and one of its derefs have a method with the same name, the dot syntax will call the method on the inherent impl (i.e. `HtmlElement` or it's [`std::ops::Deref`] Target). /// You may need to manually deref to access other methods, for example, `(*el).style()` to get the `CssStyleDeclaration` instead of calling [`leptos::HtmlElement::style`]. #[must_use = "You are creating an HtmlElement<_> but not using it. An unused view can \ diff --git a/router/src/lib.rs b/router/src/lib.rs index f05261688..b77f0e59f 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -28,7 +28,7 @@ //! ## Example //! //! ```rust -//! +//! //! use leptos::*; //! use leptos_router::*; //! diff --git a/server_fn_macro/src/lib.rs b/server_fn_macro/src/lib.rs index 885a88a92..e17d489c8 100644 --- a/server_fn_macro/src/lib.rs +++ b/server_fn_macro/src/lib.rs @@ -59,14 +59,15 @@ pub fn server_macro_impl( .inputs .iter_mut() .map(|f| { - let typed_arg = - match f { - FnArg::Receiver(_) => return Err(syn::Error::new( + let typed_arg = match f { + FnArg::Receiver(_) => { + return Err(syn::Error::new( f.span(), "cannot use receiver types in server function macro", - )), - FnArg::Typed(t) => t, - }; + )) + } + FnArg::Typed(t) => t, + }; // strip `mut`, which is allowed in fn args but not in struct fields if let Pat::Ident(ident) = &mut *typed_arg.pat {