File tree 1 file changed +2
-17
lines changed
1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -821,20 +821,8 @@ fn ssz_decode_derive_struct(item: &DeriveInput, struct_data: &DataStruct) -> Tok
821
821
}
822
822
823
823
fixed_decodes. push ( quote ! {
824
- let #ident = {
825
- start = end;
826
- end = end
827
- . checked_add( #ssz_fixed_len)
828
- . ok_or_else( || ssz:: DecodeError :: OutOfBoundsByte {
829
- i: usize :: max_value( )
830
- } ) ?;
831
- let slice = bytes. get( start..end)
832
- . ok_or_else( || ssz:: DecodeError :: InvalidByteLength {
833
- len: bytes. len( ) ,
834
- expected: end
835
- } ) ?;
836
- #from_ssz_bytes?
837
- } ;
824
+ let ( slice, bytes) = bytes. split_at( #ssz_fixed_len) ;
825
+ let #ident = #from_ssz_bytes?;
838
826
} ) ;
839
827
is_fixed_lens. push ( is_ssz_fixed_len) ;
840
828
fixed_lens. push ( ssz_fixed_len) ;
@@ -872,9 +860,6 @@ fn ssz_decode_derive_struct(item: &DeriveInput, struct_data: &DataStruct) -> Tok
872
860
} ) ;
873
861
}
874
862
875
- let mut start: usize = 0 ;
876
- let mut end = start;
877
-
878
863
#(
879
864
#fixed_decodes
880
865
) *
You can’t perform that action at this time.
0 commit comments