File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ macro_rules! group_decode {
24
24
let mut output = [ 0 ; $decoded_length] ;
25
25
b. iter( || bs58:: decode( $encoded) . into( & mut output) . unwrap( ) ) ;
26
26
} ) ;
27
+ group. bench_function( "decode_bs58_unsafe" , |b| {
28
+ b. iter( || bs58:: decode( $encoded) . into_vec_unsafe( ) . unwrap( ) )
29
+ } ) ;
27
30
group. finish( ) ;
28
31
} } ;
29
32
}
@@ -44,6 +47,9 @@ macro_rules! group_decode_long {
44
47
let mut output = [ 0 ; $decoded_length] ;
45
48
b. iter( || bs58:: decode( $encoded) . into( & mut output[ ..] ) . unwrap( ) ) ;
46
49
} ) ;
50
+ group. bench_function( "decode_bs58_unsafe" , |b| {
51
+ b. iter( || bs58:: decode( $encoded) . into_vec_unsafe( ) . unwrap( ) )
52
+ } ) ;
47
53
// bs58_noalloc_array is not possible because of limited array lengths in trait impls
48
54
group. finish( ) ;
49
55
} } ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use assert_matches::assert_matches;
7
7
fn test_decode ( ) {
8
8
for & ( val, s) in cases:: TEST_CASES . iter ( ) {
9
9
assert_eq ! ( val. to_vec( ) , bs58:: decode( s) . into_vec( ) . unwrap( ) ) ;
10
- assert_eq ! ( val. to_vec( ) , bs58:: decode:: DecodeBuilder :: new ( s , bs58 :: Alphabet :: DEFAULT ) . into_vec_unsafe( ) . unwrap( ) ) ;
10
+ assert_eq ! ( val. to_vec( ) , bs58:: decode( s ) . into_vec_unsafe( ) . unwrap( ) ) ;
11
11
}
12
12
}
13
13
You can’t perform that action at this time.
0 commit comments