Skip to content

Commit f56ae65

Browse files
committed
glib-macros: Fix various new 1.88 clippy warnings
1 parent 34285cc commit f56ae65

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

glib-macros/src/clone.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ impl Capture {
266266
CaptureKind::Weak => match weak_upgrade_failure_kind {
267267
UpgradeBehaviour::Panic => {
268268
let err_msg = format!(
269-
"Failed to upgrade `{}`. If you don't want to panic, use `#[upgrade_or]`, `#[upgrade_or_else]` or `#[upgrade_or_default]`",
270-
alias,
269+
"Failed to upgrade `{alias}`. If you don't want to panic, use `#[upgrade_or]`, `#[upgrade_or_else]` or `#[upgrade_or_default]`",
271270
);
272271
quote! {
273272
let Some(#alias) = #crate_ident::clone::Upgrade::upgrade(&#alias) else {
@@ -278,7 +277,7 @@ impl Capture {
278277
UpgradeBehaviour::Default
279278
| UpgradeBehaviour::Expression(_)
280279
| UpgradeBehaviour::Closure(_) => {
281-
let err_msg = format!("Failed to upgrade `{}`", alias);
280+
let err_msg = format!("Failed to upgrade `{alias}`");
282281
quote! {
283282
let Some(#alias) = #crate_ident::clone::Upgrade::upgrade(&#alias) else {
284283
#crate_ident::g_debug!(
@@ -290,7 +289,7 @@ impl Capture {
290289
}
291290
}
292291
UpgradeBehaviour::Unit => {
293-
let err_msg = format!("Failed to upgrade `{}`", alias);
292+
let err_msg = format!("Failed to upgrade `{alias}`");
294293
let unit_return = unit_return.unwrap_or_else(|| {
295294
quote! { return; }
296295
});

glib-macros/tests/properties.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ mod foo {
173173
String::from("Hello world!")
174174
}
175175
fn set_fizz(&self, value: String) {
176-
*self.fizz.borrow_mut() = format!("custom set: {}", value);
176+
*self.fizz.borrow_mut() = format!("custom set: {value}");
177177
}
178178
fn overridden(&self) -> u32 {
179179
43
180180
}
181181
fn set_construct_only_custom(&self, value: Option<String>) {
182182
self.construct_only_custom_setter
183-
.set(value.map(|v| format!("custom set: {}", v)))
183+
.set(value.map(|v| format!("custom set: {v}")))
184184
.expect("Setter to be only called once");
185185
}
186186
}

0 commit comments

Comments
 (0)