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