@@ -48,7 +48,8 @@ pub fn cols_ref_impl(
48
48
// The ColsRef struct is named by appending `Ref` to the struct name
49
49
let const_cols_ref_name = syn:: Ident :: new ( & format ! ( "{}Ref" , ident) , ident. span ( ) ) ;
50
50
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
52
53
let from_args = quote ! { slice: & ' a [ #generic_type] } ;
53
54
54
55
// Package all the necessary information to generate the ColsRef struct
@@ -78,7 +79,8 @@ pub fn cols_ref_impl(
78
79
// The ColsRefMut struct is named by appending `RefMut` to the struct name
79
80
let mut_cols_ref_name = syn:: Ident :: new ( & format ! ( "{}RefMut" , ident) , ident. span ( ) ) ;
80
81
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
82
84
let from_args = quote ! { slice: & ' a mut [ #generic_type] } ;
83
85
84
86
// Package all the necessary information to generate the ColsRefMut struct
@@ -117,11 +119,12 @@ struct StructInfo {
117
119
}
118
120
119
121
// 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:
122
124
// - the types of the fields
123
125
// - 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
125
128
fn make_struct ( struct_info : StructInfo , config : & proc_macro2:: Ident ) -> proc_macro2:: TokenStream {
126
129
let StructInfo {
127
130
name,
@@ -204,7 +207,8 @@ fn make_from_mut(struct_info: StructInfo, config: &proc_macro2::Ident) -> proc_m
204
207
other. #ident. view( )
205
208
}
206
209
} 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
208
212
quote ! {
209
213
other. #ident
210
214
}
@@ -217,7 +221,8 @@ fn make_from_mut(struct_info: StructInfo, config: &proc_macro2::Ident) -> proc_m
217
221
<#cols_ref_type>:: from_mut:: <C >( & other. #ident)
218
222
}
219
223
} 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
221
226
quote ! {
222
227
& other. #ident
223
228
}
0 commit comments