diff --git a/crates/rules/src/lib.rs b/crates/rules/src/lib.rs index 4d394925..b85c6668 100644 --- a/crates/rules/src/lib.rs +++ b/crates/rules/src/lib.rs @@ -2,6 +2,7 @@ mod matrix_builder; mod roles_builder; pub mod prelude { + #[allow(unused_imports)] pub(crate) use crate::matrix_builder::*; pub(crate) use crate::roles_builder::*; } diff --git a/crates/rules/src/matrix_builder.rs b/crates/rules/src/matrix_builder.rs index bbb86038..1b878d9d 100644 --- a/crates/rules/src/matrix_builder.rs +++ b/crates/rules/src/matrix_builder.rs @@ -1,6 +1,5 @@ use std::marker::PhantomData; -use sargon::RoleKind; use serde::{Deserialize, Serialize}; use crate::prelude::*; diff --git a/crates/rules/src/roles_builder.rs b/crates/rules/src/roles_builder.rs index e4d2bac9..d7df1066 100644 --- a/crates/rules/src/roles_builder.rs +++ b/crates/rules/src/roles_builder.rs @@ -157,6 +157,7 @@ pub trait BuilderOfFactorsInRole: Sized + private::UncheckedBuilderOfFactorsInRo self.threshold_factors().contains(&factor_source) } + #[allow(dead_code)] /// # Throws /// Throws an error if the specified `factor_source` was not in any of the two lists. fn remove_factor_source(&mut self, factor_source: &FactorSource) -> RoleBuilderMutateResult; @@ -167,8 +168,7 @@ pub trait BuilderOfFactorsInRole: Sized + private::UncheckedBuilderOfFactorsInRo ) -> bool { self.override_factors() .into_iter() - .find(|f| f.factor_source_kind() == factor_source_kind) - .is_some() + .any(|f| f.factor_source_kind() == factor_source_kind) } fn threshold_contains_factor_source_of_kind( @@ -177,8 +177,7 @@ pub trait BuilderOfFactorsInRole: Sized + private::UncheckedBuilderOfFactorsInRo ) -> bool { self.threshold_factors() .into_iter() - .find(|f| f.factor_source_kind() == factor_source_kind) - .is_some() + .any(|f| f.factor_source_kind() == factor_source_kind) } /// If Ok => self is mutated @@ -287,6 +286,7 @@ pub trait BuilderOfFactorsInRole: Sized + private::UncheckedBuilderOfFactorsInRo fn contains_factor_source(&self, factor_source: &FactorSource) -> bool; fn contains_factor_source_of_kind(&self, factor_source_kind: FactorSourceKind) -> bool; + #[allow(dead_code)] /// For each factor source in the given set, return a validation status /// for adding it to factor list of the given kind (`factor_list_kind`) fn validation_for_addition_of_factor_source_for_each( @@ -473,7 +473,6 @@ impl BuilderOfFactorsInRole for RoleBuilder { } mod private { - use crate::prelude::MatrixBuilder; use super::*; pub trait UncheckedBuilderOfFactorsInRole { @@ -567,6 +566,7 @@ mod tests { use super::*; + #[allow(clippy::upper_case_acronyms)] type SUT = RoleBuilder; type MutRes = RoleBuilderMutateResult;