1
1
use bc_shamir:: MAX_SHARE_COUNT ;
2
2
3
- use crate :: Error ;
3
+ use crate :: { Error , Result } ;
4
4
5
5
/// A specification for an SSKR split.
6
6
#[ derive( Debug , Clone , PartialEq ) ]
@@ -24,7 +24,7 @@ impl Spec {
24
24
/// Returns an error if the group threshold is zero, if the group threshold
25
25
/// is greater than the number of groups, or if the number of groups is
26
26
/// greater than the maximum share count.
27
- pub fn new ( group_threshold : usize , groups : Vec < GroupSpec > ) -> Result < Self , Error > {
27
+ pub fn new ( group_threshold : usize , groups : Vec < GroupSpec > ) -> Result < Self > {
28
28
if group_threshold == 0 {
29
29
return Err ( Error :: GroupThresholdInvalid ) ;
30
30
}
@@ -83,7 +83,7 @@ impl GroupSpec {
83
83
/// Returns an error if the member count is zero, if the member count is
84
84
/// greater than the maximum share count, or if the member threshold is
85
85
/// greater than the member count.
86
- pub fn new ( member_threshold : usize , member_count : usize ) -> Result < Self , Error > {
86
+ pub fn new ( member_threshold : usize , member_count : usize ) -> Result < Self > {
87
87
if member_count == 0 {
88
88
return Err ( Error :: MemberCountInvalid ) ;
89
89
}
@@ -107,7 +107,7 @@ impl GroupSpec {
107
107
}
108
108
109
109
/// Parses a group specification from a string.
110
- pub fn parse ( s : & str ) -> Result < Self , Error > {
110
+ pub fn parse ( s : & str ) -> Result < Self > {
111
111
let parts: Vec < & str > = s. split ( '-' ) . collect ( ) ;
112
112
if parts. len ( ) != 3 {
113
113
return Err ( Error :: GroupSpecInvalid ) ;
0 commit comments