Skip to content

Commit cc2b361

Browse files
nyurikemilio
authored andcommitted
chore: inline format args
1 parent 9366e0a commit cc2b361

File tree

6 files changed

+9
-15
lines changed

6 files changed

+9
-15
lines changed

bindgen-tests/tests/expectations/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ fn main() {
4747
test_string.push_str(&format!(
4848
r###"
4949
#[path = "{}"]
50-
mod {};
50+
mod {module_name};
5151
"###,
5252
path.display().to_string().replace('\\', "\\\\"),
53-
module_name,
5453
));
5554
}
5655
}

bindgen-tests/tests/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,8 @@ fn compare_generated_header(
183183
}
184184
None => panic!(
185185
"missing test expectation file and/or '__testing_only_libclang_$VERSION' \
186-
feature for header '{}'; looking for expectation file at '{:?}'",
186+
feature for header '{}'; looking for expectation file at '{looked_at:?}'",
187187
header.display(),
188-
looked_at,
189188
),
190189
}
191190

bindgen/codegen/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub(crate) fn blob(
107107
}
108108

109109
ctx.generated_opaque_array(align);
110-
let ident = format_ident!("__BindgenOpaqueArray{}", align);
110+
let ident = format_ident!("__BindgenOpaqueArray{align}");
111111
let size = layout.size;
112112
if ctx.options().enable_cxx_namespaces {
113113
syn::parse_quote! { root::#ident<[u8; #size]> }

bindgen/codegen/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5617,7 +5617,7 @@ pub(crate) mod utils {
56175617
let ident = if align == 1 {
56185618
format_ident!("__BindgenOpaqueArray")
56195619
} else {
5620-
format_ident!("__BindgenOpaqueArray{}", align)
5620+
format_ident!("__BindgenOpaqueArray{align}")
56215621
};
56225622
let repr = if align <= 1 {
56235623
quote! { #[repr(C)] }

bindgen/ir/item.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,7 @@ impl Item {
17011701
if let Err(ParseError::Recurse) = result {
17021702
warn!(
17031703
"Unknown type, assuming named template type: \
1704-
id = {:?}; spelling = {}",
1705-
id,
1704+
id = {id:?}; spelling = {}",
17061705
ty.spelling()
17071706
);
17081707
Item::type_param(Some(id), location, ctx)
@@ -1732,13 +1731,10 @@ impl Item {
17321731

17331732
debug!(
17341733
"Item::type_param:\n\
1735-
\twith_id = {:?},\n\
1736-
\tty = {} {:?},\n\
1737-
\tlocation: {:?}",
1738-
with_id,
1734+
\twith_id = {with_id:?},\n\
1735+
\tty = {} {ty:?},\n\
1736+
\tlocation: {location:?}",
17391737
ty.spelling(),
1740-
ty,
1741-
location
17421738
);
17431739

17441740
if ty.kind() != clang_sys::CXType_Unexposed {

bindgen/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ fn rust_to_clang_target(rust_target: &str) -> Box<str> {
685685

686686
let mut triple: Vec<&str> = rust_target.split_terminator('-').collect();
687687

688-
assert!(!triple.is_empty(), "{}", TRIPLE_HYPHENS_MESSAGE);
688+
assert!(!triple.is_empty(), "{TRIPLE_HYPHENS_MESSAGE}");
689689
triple.resize(4, "");
690690

691691
// RISC-V

0 commit comments

Comments
 (0)