mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-28 05:21:14 +00:00
Fix clippy warnings in rust nightly 1.85
This commit is contained in:
parent
e08c28c126
commit
430b99bdac
4
.github/workflows/rust.yml
vendored
4
.github/workflows/rust.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
tool: cargo-nextest
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- 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:
|
||||
strategy:
|
||||
@ -48,7 +48,7 @@ jobs:
|
||||
with:
|
||||
tool: cargo-nextest
|
||||
- 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
|
||||
|
||||
Docs:
|
||||
|
@ -601,14 +601,14 @@ const _: () = {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, S: FastWritable + ?Sized> WriteWritable for &Writable<'a, S> {
|
||||
impl<S: FastWritable + ?Sized> WriteWritable for &Writable<'_, S> {
|
||||
#[inline]
|
||||
fn rinja_write<W: fmt::Write + ?Sized>(&self, dest: &mut W) -> crate::Result<()> {
|
||||
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]
|
||||
fn rinja_write<W: fmt::Write + ?Sized>(&self, dest: &mut W) -> crate::Result<()> {
|
||||
Ok(write!(dest, "{}", self.0)?)
|
||||
|
@ -42,7 +42,7 @@ struct ConfigKey<'a> {
|
||||
template_whitespace: Option<Whitespace>,
|
||||
}
|
||||
|
||||
impl<'a> ToOwned for ConfigKey<'a> {
|
||||
impl ToOwned for ConfigKey<'_> {
|
||||
type Owned = OwnedConfigKey;
|
||||
|
||||
fn to_owned(&self) -> Self::Owned {
|
||||
|
@ -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;
|
||||
|
||||
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 {
|
||||
&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 {
|
||||
write!(f, "{:?}", self.inner)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T: Clone> Clone for WithSpan<'a, T> {
|
||||
impl<T: Clone> Clone for WithSpan<'_, T> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
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 {
|
||||
// We never want to compare the span information.
|
||||
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]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt_syntax("Syntax", self, f)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> fmt::Debug for InnerSyntax<'a> {
|
||||
impl fmt::Debug for InnerSyntax<'_> {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt_syntax("InnerSyntax", self, f)
|
||||
|
@ -648,12 +648,10 @@ impl<'a> Macro<'a> {
|
||||
.parse_next(i)?;
|
||||
match args {
|
||||
Some((args, Some(_))) => Ok((i, args)),
|
||||
Some((_, None)) => {
|
||||
return Err(winnow::error::ErrMode::Cut(ErrorContext::new(
|
||||
"expected `)` to close macro argument list",
|
||||
i,
|
||||
)));
|
||||
}
|
||||
Some((_, None)) => Err(winnow::error::ErrMode::Cut(ErrorContext::new(
|
||||
"expected `)` to close macro argument list",
|
||||
i,
|
||||
))),
|
||||
None => Ok((i, None)),
|
||||
}
|
||||
};
|
||||
|
@ -7,7 +7,7 @@ struct SelfMethodTemplate<'a> {
|
||||
}
|
||||
|
||||
impl<'a> SelfMethodTemplate<'a> {
|
||||
fn get_s(&self) -> &str {
|
||||
fn get_s(&self) -> &'a str {
|
||||
self.s
|
||||
}
|
||||
}
|
||||
@ -43,7 +43,7 @@ fn test_nested() {
|
||||
}
|
||||
|
||||
impl<'a> NestedSelfMethodTemplate<'a> {
|
||||
fn get_s(&self) -> &str {
|
||||
fn get_s(&self) -> &'a str {
|
||||
"bar"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user