Fix clippy warnings in rust nightly 1.85

This commit is contained in:
René Kijewski 2024-12-11 00:58:35 +01:00
parent e08c28c126
commit 430b99bdac
6 changed files with 18 additions and 20 deletions

View File

@ -29,7 +29,7 @@ jobs:
tool: cargo-nextest tool: cargo-nextest
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: cargo build --all-targets --features full - run: cargo build --all-targets --features full
- run: cargo nextest run --all-targets --features full - run: cargo nextest run --all-targets --no-tests=warn --features full
Package: Package:
strategy: strategy:
@ -48,7 +48,7 @@ jobs:
with: with:
tool: cargo-nextest tool: cargo-nextest
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- run: cd ${{ matrix.package }} && cargo nextest run - run: cd ${{ matrix.package }} && cargo nextest run --no-tests=warn
- run: cd ${{ matrix.package }} && cargo clippy --all-targets -- -D warnings - run: cd ${{ matrix.package }} && cargo clippy --all-targets -- -D warnings
Docs: Docs:

View File

@ -601,14 +601,14 @@ const _: () = {
} }
} }
impl<'a, S: FastWritable + ?Sized> WriteWritable for &Writable<'a, S> { impl<S: FastWritable + ?Sized> WriteWritable for &Writable<'_, S> {
#[inline] #[inline]
fn rinja_write<W: fmt::Write + ?Sized>(&self, dest: &mut W) -> crate::Result<()> { fn rinja_write<W: fmt::Write + ?Sized>(&self, dest: &mut W) -> crate::Result<()> {
self.0.write_into(dest) self.0.write_into(dest)
} }
} }
impl<'a, S: fmt::Display + ?Sized> WriteWritable for &&Writable<'a, S> { impl<S: fmt::Display + ?Sized> WriteWritable for &&Writable<'_, S> {
#[inline] #[inline]
fn rinja_write<W: fmt::Write + ?Sized>(&self, dest: &mut W) -> crate::Result<()> { fn rinja_write<W: fmt::Write + ?Sized>(&self, dest: &mut W) -> crate::Result<()> {
Ok(write!(dest, "{}", self.0)?) Ok(write!(dest, "{}", self.0)?)

View File

@ -42,7 +42,7 @@ struct ConfigKey<'a> {
template_whitespace: Option<Whitespace>, template_whitespace: Option<Whitespace>,
} }
impl<'a> ToOwned for ConfigKey<'a> { impl ToOwned for ConfigKey<'_> {
type Owned = OwnedConfigKey; type Owned = OwnedConfigKey;
fn to_owned(&self) -> Self::Owned { fn to_owned(&self) -> Self::Owned {

View File

@ -209,7 +209,7 @@ impl<'a, T> WithSpan<'a, T> {
} }
} }
impl<'a, T> Deref for WithSpan<'a, T> { impl<T> Deref for WithSpan<'_, T> {
type Target = T; type Target = T;
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
@ -217,19 +217,19 @@ impl<'a, T> Deref for WithSpan<'a, T> {
} }
} }
impl<'a, T> DerefMut for WithSpan<'a, T> { impl<T> DerefMut for WithSpan<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target { fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner &mut self.inner
} }
} }
impl<'a, T: fmt::Debug> fmt::Debug for WithSpan<'a, T> { impl<T: fmt::Debug> fmt::Debug for WithSpan<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self.inner) write!(f, "{:?}", self.inner)
} }
} }
impl<'a, T: Clone> Clone for WithSpan<'a, T> { impl<T: Clone> Clone for WithSpan<'_, T> {
fn clone(&self) -> Self { fn clone(&self) -> Self {
Self { Self {
inner: self.inner.clone(), inner: self.inner.clone(),
@ -238,7 +238,7 @@ impl<'a, T: Clone> Clone for WithSpan<'a, T> {
} }
} }
impl<'a, T: PartialEq> PartialEq for WithSpan<'a, T> { impl<T: PartialEq> PartialEq for WithSpan<'_, T> {
fn eq(&self, other: &Self) -> bool { fn eq(&self, other: &Self) -> bool {
// We never want to compare the span information. // We never want to compare the span information.
self.inner == other.inner self.inner == other.inner
@ -822,14 +822,14 @@ impl Default for InnerSyntax<'static> {
} }
} }
impl<'a> fmt::Debug for Syntax<'a> { impl fmt::Debug for Syntax<'_> {
#[inline] #[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt_syntax("Syntax", self, f) fmt_syntax("Syntax", self, f)
} }
} }
impl<'a> fmt::Debug for InnerSyntax<'a> { impl fmt::Debug for InnerSyntax<'_> {
#[inline] #[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt_syntax("InnerSyntax", self, f) fmt_syntax("InnerSyntax", self, f)

View File

@ -648,12 +648,10 @@ impl<'a> Macro<'a> {
.parse_next(i)?; .parse_next(i)?;
match args { match args {
Some((args, Some(_))) => Ok((i, args)), Some((args, Some(_))) => Ok((i, args)),
Some((_, None)) => { Some((_, None)) => Err(winnow::error::ErrMode::Cut(ErrorContext::new(
return Err(winnow::error::ErrMode::Cut(ErrorContext::new(
"expected `)` to close macro argument list", "expected `)` to close macro argument list",
i, i,
))); ))),
}
None => Ok((i, None)), None => Ok((i, None)),
} }
}; };

View File

@ -7,7 +7,7 @@ struct SelfMethodTemplate<'a> {
} }
impl<'a> SelfMethodTemplate<'a> { impl<'a> SelfMethodTemplate<'a> {
fn get_s(&self) -> &str { fn get_s(&self) -> &'a str {
self.s self.s
} }
} }
@ -43,7 +43,7 @@ fn test_nested() {
} }
impl<'a> NestedSelfMethodTemplate<'a> { impl<'a> NestedSelfMethodTemplate<'a> {
fn get_s(&self) -> &str { fn get_s(&self) -> &'a str {
"bar" "bar"
} }
} }