Skip to content

Commit

Permalink
Get rid of unnecessary double-borrowing to fix clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Kahl authored and cuviper committed Jul 5, 2023
1 parent e43b75e commit aef0b5e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl NumTraits {
if self.explicit {
output
} else {
dummy_const_trick(trait_, &name, output)
dummy_const_trick(trait_, name, output)
}
}
}
Expand Down Expand Up @@ -369,7 +369,7 @@ pub fn from_primitive(input: TokenStream) -> TokenStream {
}
};

import.wrap("FromPrimitive", &name, impl_).into()
import.wrap("FromPrimitive", name, impl_).into()
}

/// Derives [`num_traits::ToPrimitive`][to] for simple enums and newtypes.
Expand Down Expand Up @@ -544,7 +544,7 @@ pub fn to_primitive(input: TokenStream) -> TokenStream {
}
};

import.wrap("ToPrimitive", &name, impl_).into()
import.wrap("ToPrimitive", name, impl_).into()
}

const NEWTYPE_ONLY: &str = "This trait can only be derived for newtypes";
Expand Down Expand Up @@ -623,7 +623,7 @@ pub fn num_cast(input: TokenStream) -> TokenStream {
}
};

import.wrap("NumCast", &name, impl_).into()
import.wrap("NumCast", name, impl_).into()
}

/// Derives [`num_traits::Zero`][zero] for newtypes. The inner type must already implement `Zero`.
Expand All @@ -650,7 +650,7 @@ pub fn zero(input: TokenStream) -> TokenStream {
}
};

import.wrap("Zero", &name, impl_).into()
import.wrap("Zero", name, impl_).into()
}

/// Derives [`num_traits::One`][one] for newtypes. The inner type must already implement `One`.
Expand All @@ -677,7 +677,7 @@ pub fn one(input: TokenStream) -> TokenStream {
}
};

import.wrap("One", &name, impl_).into()
import.wrap("One", name, impl_).into()
}

/// Derives [`num_traits::Num`][num] for newtypes. The inner type must already implement `Num`.
Expand All @@ -701,7 +701,7 @@ pub fn num(input: TokenStream) -> TokenStream {
}
};

import.wrap("Num", &name, impl_).into()
import.wrap("Num", name, impl_).into()
}

/// Derives [`num_traits::Float`][float] for newtypes. The inner type must already implement
Expand Down Expand Up @@ -950,5 +950,5 @@ pub fn float(input: TokenStream) -> TokenStream {
}
};

import.wrap("Float", &name, impl_).into()
import.wrap("Float", name, impl_).into()
}

0 comments on commit aef0b5e

Please sign in to comment.