File tree 14 files changed +42
-42
lines changed
14 files changed +42
-42
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 48 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 48 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 48 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 48 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 48 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 48 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 48 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 48 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ impl AnemoiDigest {
40
40
41
41
/// Returns an array of bytes corresponding to the digest
42
42
pub fn to_bytes ( & self ) -> [ u8 ; 32 ] {
43
- let mut bytes = Vec :: new ( ) ;
44
- self . 0 [ 0 ] . serialize_compressed ( & mut bytes) . unwrap ( ) ;
45
- bytes. try_into ( ) . unwrap ( )
43
+ let mut bytes = [ 0u8 ; 32 ] ;
44
+ self . 0 [ 0 ] . serialize_compressed ( & mut bytes[ .. ] ) . unwrap ( ) ;
45
+ bytes
46
46
}
47
47
}
48
48
You can’t perform that action at this time.
0 commit comments