From f1792bbf5e3196e5c043b647eebf50c9ab5a167a Mon Sep 17 00:00:00 2001 From: banditopazzo Date: Tue, 10 Dec 2024 17:58:11 +0100 Subject: [PATCH] chore: fix lint errors for clippy 1.83 --- crates/modules/rules-engine/src/ruleset.rs | 8 +++++++- crates/validatron/examples/ruleset.rs | 5 ++++- crates/validatron/src/validator.rs | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/modules/rules-engine/src/ruleset.rs b/crates/modules/rules-engine/src/ruleset.rs index 5ee1e3ae..bc34bd32 100644 --- a/crates/modules/rules-engine/src/ruleset.rs +++ b/crates/modules/rules-engine/src/ruleset.rs @@ -45,7 +45,13 @@ impl Ruleset { } /// Perform the check on an instance of a type `T` and returns an iterator over the matching rules. - pub fn matches<'a>(&'a self, e: &'a T) -> impl Iterator> { + pub fn matches<'a, 'b>( + &'a self, + e: &'b T, + ) -> impl Iterator> + where + 'a: 'b, + { self.rules.iter().filter(|r| r.rule.is_match(e)) } } diff --git a/crates/validatron/examples/ruleset.rs b/crates/validatron/examples/ruleset.rs index 9e8d3512..dbe5aeb8 100644 --- a/crates/validatron/examples/ruleset.rs +++ b/crates/validatron/examples/ruleset.rs @@ -33,7 +33,10 @@ impl Ruleset { } /// Perform the check on an instance of a type `T` and returns an iterator over the matching rules. - pub fn matches<'a>(&'a self, e: &'a T) -> impl Iterator> { + pub fn matches<'a, 'b>(&'a self, e: &'b T) -> impl Iterator> + where + 'a: 'b, + { self.rules.iter().filter(|rule| rule.is_match(e)) } } diff --git a/crates/validatron/src/validator.rs b/crates/validatron/src/validator.rs index f6ccb49a..a5f03f33 100644 --- a/crates/validatron/src/validator.rs +++ b/crates/validatron/src/validator.rs @@ -25,7 +25,7 @@ enum Leaf<'a> { Owned(Box), // methods need a relaxed leaf type } -impl<'a> Deref for Leaf<'a> { +impl Deref for Leaf<'_> { type Target = dyn Any; fn deref(&self) -> &Self::Target {