Skip to content

Commit

Permalink
[no ci] clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
CyonAlexRDX committed Nov 25, 2024
1 parent 6d7c038 commit a2b38ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions crates/rules/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
}
1 change: 0 additions & 1 deletion crates/rules/src/matrix_builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::marker::PhantomData;

use sargon::RoleKind;
use serde::{Deserialize, Serialize};

use crate::prelude::*;
Expand Down
10 changes: 5 additions & 5 deletions crates/rules/src/roles_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -473,7 +473,6 @@ impl BuilderOfFactorsInRole for RoleBuilder {
}

mod private {
use crate::prelude::MatrixBuilder;

use super::*;
pub trait UncheckedBuilderOfFactorsInRole {
Expand Down Expand Up @@ -567,6 +566,7 @@ mod tests {

use super::*;

#[allow(clippy::upper_case_acronyms)]
type SUT = RoleBuilder;
type MutRes = RoleBuilderMutateResult;

Expand Down

0 comments on commit a2b38ae

Please sign in to comment.