Skip to content

Commit cc9f281

Browse files
Fix linter errors
1 parent f5fbbfd commit cc9f281

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub fn cols_ref_impl(
6363
.collect_vec();
6464

6565
// The ColsRef struct is named by appending `Ref` to the struct name
66-
let const_cols_ref_name = syn::Ident::new(&format!("{}Ref", ident), ident.span());
66+
let const_cols_ref_name = syn::Ident::new(&format!("{ident}Ref"), ident.span());
6767

6868
// the args to the `from` method will be different for the ColsRef and ColsRefMut
6969
// structs
@@ -94,7 +94,7 @@ pub fn cols_ref_impl(
9494
.collect_vec();
9595

9696
// The ColsRefMut struct is named by appending `RefMut` to the struct name
97-
let mut_cols_ref_name = syn::Ident::new(&format!("{}RefMut", ident), ident.span());
97+
let mut_cols_ref_name = syn::Ident::new(&format!("{ident}RefMut"), ident.span());
9898

9999
// the args to the `from` method will be different for the ColsRef and ColsRefMut
100100
// structs
@@ -642,7 +642,7 @@ fn get_const_cols_ref_type(
642642
lifetime: syn::Lifetime,
643643
) -> syn::TypePath {
644644
if !is_columns_struct(ty) {
645-
panic!("Expected a columns struct, got {:?}", ty);
645+
panic!("Expected a columns struct, got {ty:?}");
646646
}
647647

648648
if let syn::Type::Path(type_path) = ty {
@@ -654,21 +654,18 @@ fn get_const_cols_ref_type(
654654
};
655655
const_cols_ref_type
656656
} else {
657-
panic!("is_columns_struct returned true for type {:?} but the last segment is not a columns struct", ty);
657+
panic!("is_columns_struct returned true for type {ty:?} but the last segment is not a columns struct");
658658
}
659659
} else {
660-
panic!(
661-
"is_columns_struct returned true but the type {:?} is not a path",
662-
ty
663-
);
660+
panic!("is_columns_struct returned true but the type {ty:?} is not a path",);
664661
}
665662
}
666663

667664
// If 'ty' is a struct that derives ColsRef, return the ColsRefMut struct type
668665
// Otherwise, return None
669666
fn get_mut_cols_ref_type(ty: &syn::Type, generic_type: &syn::TypeParam) -> syn::TypePath {
670667
if !is_columns_struct(ty) {
671-
panic!("Expected a columns struct, got {:?}", ty);
668+
panic!("Expected a columns struct, got {ty:?}");
672669
}
673670

674671
if let syn::Type::Path(type_path) = ty {
@@ -680,13 +677,10 @@ fn get_mut_cols_ref_type(ty: &syn::Type, generic_type: &syn::TypeParam) -> syn::
680677
};
681678
mut_cols_ref_type
682679
} else {
683-
panic!("is_columns_struct returned true for type {:?} but the last segment is not a columns struct", ty);
680+
panic!("is_columns_struct returned true for type {ty:?} but the last segment is not a columns struct");
684681
}
685682
} else {
686-
panic!(
687-
"is_columns_struct returned true but the type {:?} is not a path",
688-
ty
689-
);
683+
panic!("is_columns_struct returned true but the type {ty:?} is not a path",);
690684
}
691685
}
692686

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn get_elem_type(ty: &Type) -> Type {
4848
match ty {
4949
Type::Array(array) => get_elem_type(array.elem.as_ref()),
5050
Type::Path(_) => ty.clone(),
51-
_ => panic!("Unsupported type: {:?}", ty),
51+
_ => panic!("Unsupported type: {ty}"),
5252
}
5353
}
5454

crates/circuits/primitives/derive/tests/test_cols_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn test_cols_ref() {
6464
cols.nested_array_of_aligned_borrow[[0, 0]].b[0] = 11;
6565

6666
let cols: TestColsRef<i32> = TestColsRef::from::<TestConfigImpl>(&input);
67-
println!("{:?}", cols);
67+
println!("{cols:?}");
6868
assert_eq!(*cols.single_field_element, 1);
6969
assert_eq!(cols.array_of_t[0], 2);
7070
assert_eq!(cols.nested_array_of_t[[0, 0]], 3);

0 commit comments

Comments
 (0)