Skip to content

Commit 665237e

Browse files
Fix lint
1 parent 1d4bd1f commit 665237e

File tree

1 file changed

+12
-7
lines changed
  • crates/circuits/primitives/derive/src/cols_ref

1 file changed

+12
-7
lines changed

crates/circuits/primitives/derive/src/cols_ref/mod.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ pub fn cols_ref_impl(
4848
// The ColsRef struct is named by appending `Ref` to the struct name
4949
let const_cols_ref_name = syn::Ident::new(&format!("{}Ref", ident), ident.span());
5050

51-
// the args to the `from` method will be different for the ColsRef and ColsRefMut structs
51+
// the args to the `from` method will be different for the ColsRef and ColsRefMut
52+
// structs
5253
let from_args = quote! { slice: &'a [#generic_type] };
5354

5455
// Package all the necessary information to generate the ColsRef struct
@@ -78,7 +79,8 @@ pub fn cols_ref_impl(
7879
// The ColsRefMut struct is named by appending `RefMut` to the struct name
7980
let mut_cols_ref_name = syn::Ident::new(&format!("{}RefMut", ident), ident.span());
8081

81-
// the args to the `from` method will be different for the ColsRef and ColsRefMut structs
82+
// the args to the `from` method will be different for the ColsRef and ColsRefMut
83+
// structs
8284
let from_args = quote! { slice: &'a mut [#generic_type] };
8385

8486
// Package all the necessary information to generate the ColsRefMut struct
@@ -117,11 +119,12 @@ struct StructInfo {
117119
}
118120

119121
// Generate the ColsRef and ColsRefMut structs, depending on the value of `struct_info`
120-
// This function is meant to reduce code duplication between the code needed to generate the two structs
121-
// Notable differences between the two structs are:
122+
// This function is meant to reduce code duplication between the code needed to generate the two
123+
// structs Notable differences between the two structs are:
122124
// - the types of the fields
123125
// - ColsRef derives Clone, but ColsRefMut cannot (since it stores mutable references)
124-
// - the `from` method parameter is a reference to a slice for ColsRef and a mutable reference to a slice for ColsRefMut
126+
// - the `from` method parameter is a reference to a slice for ColsRef and a mutable reference to
127+
// a slice for ColsRefMut
125128
fn make_struct(struct_info: StructInfo, config: &proc_macro2::Ident) -> proc_macro2::TokenStream {
126129
let StructInfo {
127130
name,
@@ -204,7 +207,8 @@ fn make_from_mut(struct_info: StructInfo, config: &proc_macro2::Ident) -> proc_m
204207
other.#ident.view()
205208
}
206209
} else if derives_aligned_borrow {
207-
// implicitly converts a mutable reference to an immutable reference, so leave the field value unchanged
210+
// implicitly converts a mutable reference to an immutable reference, so leave the
211+
// field value unchanged
208212
quote! {
209213
other.#ident
210214
}
@@ -217,7 +221,8 @@ fn make_from_mut(struct_info: StructInfo, config: &proc_macro2::Ident) -> proc_m
217221
<#cols_ref_type>::from_mut::<C>(&other.#ident)
218222
}
219223
} else if is_generic_type(&f.ty, &generic_type) {
220-
// implicitly converts a mutable reference to an immutable reference, so leave the field value unchanged
224+
// implicitly converts a mutable reference to an immutable reference, so leave the
225+
// field value unchanged
221226
quote! {
222227
&other.#ident
223228
}

0 commit comments

Comments
 (0)