mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 09:54:41 -05:00
fix: clippy errors (#3772)
* fix: use map instead of if else * fix: needless lifetime
This commit is contained in:
@@ -63,7 +63,7 @@ delegate_impl_len!(<T,> Vec<T>);
|
||||
delegate_impl_len!(str);
|
||||
delegate_impl_len!(String);
|
||||
|
||||
impl<'a> Len for Cow<'a, str> {
|
||||
impl Len for Cow<'_, str> {
|
||||
#[inline(always)]
|
||||
fn len(&self) -> usize {
|
||||
<str>::len(self)
|
||||
@@ -75,7 +75,7 @@ impl<'a> Len for Cow<'a, str> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Len for &Cow<'a, str> {
|
||||
impl Len for &Cow<'_, str> {
|
||||
#[inline(always)]
|
||||
fn len(&self) -> usize {
|
||||
Len::len(*self)
|
||||
@@ -87,7 +87,7 @@ impl<'a> Len for &Cow<'a, str> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Len for &mut Cow<'a, str> {
|
||||
impl Len for &mut Cow<'_, str> {
|
||||
#[inline(always)]
|
||||
fn len(&self) -> usize {
|
||||
Len::len(*self)
|
||||
@@ -99,7 +99,7 @@ impl<'a> Len for &mut Cow<'a, str> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> Len for Cow<'a, [T]>
|
||||
impl<T> Len for Cow<'_, [T]>
|
||||
where
|
||||
[T]: ToOwned,
|
||||
{
|
||||
@@ -114,7 +114,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> Len for &Cow<'a, [T]>
|
||||
impl<T> Len for &Cow<'_, [T]>
|
||||
where
|
||||
[T]: ToOwned,
|
||||
{
|
||||
@@ -129,7 +129,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> Len for &mut Cow<'a, [T]>
|
||||
impl<T> Len for &mut Cow<'_, [T]>
|
||||
where
|
||||
[T]: ToOwned,
|
||||
{
|
||||
|
||||
@@ -648,16 +648,11 @@ impl ServerFnCall {
|
||||
|
||||
/// Return the name and type of the first field if there is only one field.
|
||||
fn single_field(&self) -> Option<(&Pat, &Type)> {
|
||||
if let Some(field) = self
|
||||
.body
|
||||
self.body
|
||||
.inputs
|
||||
.first()
|
||||
.filter(|_| self.body.inputs.len() == 1)
|
||||
{
|
||||
Some((&field.arg.pat, &field.arg.ty))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
.map(|field| (&*field.arg.pat, &*field.arg.ty))
|
||||
}
|
||||
|
||||
fn deref_impl(&self) -> TokenStream2 {
|
||||
|
||||
Reference in New Issue
Block a user