Clippy fixes

This commit is contained in:
mdecimus
2024-12-01 20:13:06 +13:00
parent 4f02e4c96f
commit 03d9dabed3
27 changed files with 115 additions and 119 deletions

View File

@@ -139,7 +139,7 @@ where
{
struct AnyBoolVisitor;
impl<'de> Visitor<'de> for AnyBoolVisitor {
impl Visitor<'_> for AnyBoolVisitor {
type Value = bool;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {

View File

@@ -144,7 +144,7 @@ pub trait ApplyString<'x> {
fn transform(&self, f: impl Fn(&'_ str) -> Variable) -> Variable;
}
impl<'x> ApplyString<'x> for Variable {
impl ApplyString<'_> for Variable {
fn transform(&self, f: impl Fn(&'_ str) -> Variable) -> Variable {
match self {
Variable::String(s) => f(s),

View File

@@ -344,7 +344,7 @@ async fn exec_remote_(ctx: &PluginContext<'_>) -> trc::Result<Variable> {
// Update expiration
list.expires = Instant::now() + expires;
return Ok(list.entries.contains(item.as_ref()).into());
Ok(list.entries.contains(item.as_ref()).into())
} else {
trc::bail!(trc::SieveEvent::RuntimeError
.into_err()

View File

@@ -165,7 +165,7 @@ pub trait PyzorCheck {
fn pyzor_check_message(&self) -> String;
}
impl<'x, W: Write> PyzorDigest<W> for Message<'x> {
impl<W: Write> PyzorDigest<W> for Message<'_> {
fn pyzor_digest(&self, writer: W) -> W {
let parts = self
.parts
@@ -181,7 +181,7 @@ impl<'x, W: Write> PyzorDigest<W> for Message<'x> {
}
}
impl<'x> PyzorCheck for Message<'x> {
impl PyzorCheck for Message<'_> {
fn pyzor_check_message(&self) -> String {
let time = SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)