diff --git a/bindgen-tests/tests/expectations/build.rs b/bindgen-tests/tests/expectations/build.rs index 6136823e21..f4ded7e12d 100644 --- a/bindgen-tests/tests/expectations/build.rs +++ b/bindgen-tests/tests/expectations/build.rs @@ -47,10 +47,9 @@ fn main() { test_string.push_str(&format!( r###" #[path = "{}"] -mod {}; +mod {module_name}; "###, path.display().to_string().replace('\\', "\\\\"), - module_name, )); } } diff --git a/bindgen-tests/tests/tests.rs b/bindgen-tests/tests/tests.rs index 27e8108052..6e3c358d3e 100644 --- a/bindgen-tests/tests/tests.rs +++ b/bindgen-tests/tests/tests.rs @@ -183,9 +183,8 @@ fn compare_generated_header( } None => panic!( "missing test expectation file and/or '__testing_only_libclang_$VERSION' \ - feature for header '{}'; looking for expectation file at '{:?}'", + feature for header '{}'; looking for expectation file at '{looked_at:?}'", header.display(), - looked_at, ), } diff --git a/bindgen/codegen/helpers.rs b/bindgen/codegen/helpers.rs index 19338ee65f..49928cce3a 100644 --- a/bindgen/codegen/helpers.rs +++ b/bindgen/codegen/helpers.rs @@ -107,7 +107,7 @@ pub(crate) fn blob( } ctx.generated_opaque_array(align); - let ident = format_ident!("__BindgenOpaqueArray{}", align); + let ident = format_ident!("__BindgenOpaqueArray{align}"); let size = layout.size; if ctx.options().enable_cxx_namespaces { syn::parse_quote! { root::#ident<[u8; #size]> } diff --git a/bindgen/codegen/mod.rs b/bindgen/codegen/mod.rs index 295029e0d9..371f9e6609 100644 --- a/bindgen/codegen/mod.rs +++ b/bindgen/codegen/mod.rs @@ -5617,7 +5617,7 @@ pub(crate) mod utils { let ident = if align == 1 { format_ident!("__BindgenOpaqueArray") } else { - format_ident!("__BindgenOpaqueArray{}", align) + format_ident!("__BindgenOpaqueArray{align}") }; let repr = if align <= 1 { quote! { #[repr(C)] } diff --git a/bindgen/ir/item.rs b/bindgen/ir/item.rs index 260c5e8764..47aa248688 100644 --- a/bindgen/ir/item.rs +++ b/bindgen/ir/item.rs @@ -1701,8 +1701,7 @@ impl Item { if let Err(ParseError::Recurse) = result { warn!( "Unknown type, assuming named template type: \ - id = {:?}; spelling = {}", - id, + id = {id:?}; spelling = {}", ty.spelling() ); Item::type_param(Some(id), location, ctx) @@ -1732,13 +1731,10 @@ impl Item { debug!( "Item::type_param:\n\ - \twith_id = {:?},\n\ - \tty = {} {:?},\n\ - \tlocation: {:?}", - with_id, + \twith_id = {with_id:?},\n\ + \tty = {} {ty:?},\n\ + \tlocation: {location:?}", ty.spelling(), - ty, - location ); if ty.kind() != clang_sys::CXType_Unexposed { diff --git a/bindgen/lib.rs b/bindgen/lib.rs index 3582e6af80..f2c8870e05 100644 --- a/bindgen/lib.rs +++ b/bindgen/lib.rs @@ -685,7 +685,7 @@ fn rust_to_clang_target(rust_target: &str) -> Box { let mut triple: Vec<&str> = rust_target.split_terminator('-').collect(); - assert!(!triple.is_empty(), "{}", TRIPLE_HYPHENS_MESSAGE); + assert!(!triple.is_empty(), "{TRIPLE_HYPHENS_MESSAGE}"); triple.resize(4, ""); // RISC-V