File tree 1 file changed +6
-5
lines changed
crates/circuits/sha-macros/src 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,8 @@ fn make_struct(struct_info: StructInfo, config: &proc_macro2::Ident) -> proc_mac
180
180
}
181
181
}
182
182
183
- pub fn len<C : #config>( ) -> usize {
183
+ // returns number of cells in the struct (where each cell has type T)
184
+ pub const fn width<C : #config>( ) -> usize {
184
185
0 #( + #length_exprs ) *
185
186
}
186
187
}
@@ -321,10 +322,10 @@ fn get_const_cols_ref_fields(
321
322
#const_cols_ref_type
322
323
} ,
323
324
length_expr : quote ! {
324
- <#const_cols_ref_type>:: len :: <C >( )
325
+ <#const_cols_ref_type>:: width :: <C >( )
325
326
} ,
326
327
prepare_subslice : quote ! {
327
- let #length_var = <#const_cols_ref_type>:: len :: <C >( ) ;
328
+ let #length_var = <#const_cols_ref_type>:: width :: <C >( ) ;
328
329
let ( #slice_var, slice) = slice. split_at( #length_var) ;
329
330
let #slice_var = <#const_cols_ref_type>:: from:: <C >( #slice_var) ;
330
331
} ,
@@ -433,10 +434,10 @@ fn get_mut_cols_ref_fields(
433
434
#mut_cols_ref_type
434
435
} ,
435
436
length_expr : quote ! {
436
- <#mut_cols_ref_type>:: len :: <C >( )
437
+ <#mut_cols_ref_type>:: width :: <C >( )
437
438
} ,
438
439
prepare_subslice : quote ! {
439
- let #length_var = <#mut_cols_ref_type>:: len :: <C >( ) ;
440
+ let #length_var = <#mut_cols_ref_type>:: width :: <C >( ) ;
440
441
let ( mut #slice_var, mut slice) = slice. split_at_mut( #length_var) ;
441
442
let #slice_var = <#mut_cols_ref_type>:: from:: <C >( #slice_var) ;
442
443
} ,
You can’t perform that action at this time.
0 commit comments