File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,17 @@ use std::sync::Arc;
1111macro_rules! impl_decodable_for_uint {
1212 ( $type: ident, $bit_size: expr) => {
1313 impl Decode for $type {
14+ #[ inline( always) ]
1415 fn is_ssz_fixed_len( ) -> bool {
1516 true
1617 }
1718
19+ #[ inline( always) ]
1820 fn ssz_fixed_len( ) -> usize {
1921 $bit_size / 8
2022 }
2123
24+ #[ inline( always) ]
2225 fn from_ssz_bytes( bytes: & [ u8 ] ) -> Result <Self , DecodeError > {
2326 let len = bytes. len( ) ;
2427 let expected = <Self as Decode >:: ssz_fixed_len( ) ;
Original file line number Diff line number Diff line change @@ -8,18 +8,22 @@ use std::sync::Arc;
88macro_rules! impl_encodable_for_uint {
99 ( $type: ident, $bit_size: expr) => {
1010 impl Encode for $type {
11+ #[ inline( always) ]
1112 fn is_ssz_fixed_len( ) -> bool {
1213 true
1314 }
1415
16+ #[ inline( always) ]
1517 fn ssz_fixed_len( ) -> usize {
1618 $bit_size / 8
1719 }
1820
21+ #[ inline( always) ]
1922 fn ssz_bytes_len( & self ) -> usize {
2023 $bit_size / 8
2124 }
2225
26+ #[ inline( always) ]
2327 fn ssz_append( & self , buf: & mut Vec <u8 >) {
2428 buf. extend_from_slice( & self . to_le_bytes( ) ) ;
2529 }
You can’t perform that action at this time.
0 commit comments