Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajjon committed Nov 29, 2024
1 parent 7818f76 commit 5623fde
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion crates/rules/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![allow(incomplete_features)]
#![feature(inherent_associated_types)]
#![feature(generic_const_exprs)]

mod matrices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn empty_is_err_confirmation() {
let res = sut.build();
assert_eq!(
res,
ConfirmationRoleBuilder::RoleBuilderBuildResult::not_yet_valid(
Result::not_yet_valid(
NotYetValidReason::RoleMustHaveAtLeastOneFactor
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn empty_is_err_primary() {
let res = sut.build();
assert_eq!(
res,
PrimaryRoleBuilder::RoleBuilderBuildResult::not_yet_valid(
Result::not_yet_valid(
NotYetValidReason::RoleMustHaveAtLeastOneFactor
)
);
Expand Down Expand Up @@ -615,7 +615,7 @@ mod ledger {
// Assert
assert_eq!(
sut.build(),
SUT::RoleBuilderBuildResult::Err(RoleBuilderValidation::NotYetValid(
Err(RoleBuilderValidation::NotYetValid(
NotYetValidReason::PrimaryRoleWithThresholdCannotBeZeroWithFactors
))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn empty_is_err_recovery() {
let res = sut.build();
assert_eq!(
res,
RecoveryRoleBuilder::RoleBuilderBuildResult::not_yet_valid(
Result::not_yet_valid(
NotYetValidReason::RoleMustHaveAtLeastOneFactor
)
);
Expand Down
4 changes: 1 addition & 3 deletions crates/rules/src/roles/builder/roles_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,7 @@ impl<const R: u8> RoleBuilder<R> {
}

impl<const R: u8> RoleBuilder<R> {
pub type RoleBuilderBuildResult = Result<RoleWithFactorSourceIds<R>, RoleBuilderValidation>;

pub(crate) fn build(self) -> Self::RoleBuilderBuildResult {
pub(crate) fn build(self) -> Result<RoleWithFactorSourceIds<R>, RoleBuilderValidation> {
self.validate().map(|_| {
RoleWithFactorSourceIds::with_factors(
self.get_threshold(),
Expand Down

0 comments on commit 5623fde

Please sign in to comment.