Skip to content

Commit b821180

Browse files
Fix new clippy lints
1 parent bfeea2e commit b821180

File tree

11 files changed

+44
-44
lines changed

11 files changed

+44
-44
lines changed

gdk-pixbuf/tests/check_gir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
#[test]
44
fn check_gir_file() {
55
let res = gir_format_check::check_gir_file("Gir.toml");
6-
println!("{}", res);
6+
println!("{res}");
77
assert_eq!(res.nb_errors, 0);
88
}

gio/tests/check_gir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
#[test]
44
fn check_gir_file() {
55
let res = gir_format_check::check_gir_file("Gir.toml");
6-
println!("{}", res);
6+
println!("{res}");
77
assert_eq!(res.nb_errors, 0);
88
}

glib-macros/tests/clone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ fn clone_failures() {
8484
for (index, (expr, err)) in TESTS.iter().enumerate() {
8585
let prefix = "fn main() { use glib::clone; let v = std::rc::Rc::new(1); ";
8686
let suffix = "; }";
87-
let output = format!("{}{}{}", prefix, expr, suffix);
87+
let output = format!("{prefix}{expr}{suffix}");
8888

89-
t.compile_fail_inline_check_sub(&format!("test_{}", index), &output, err);
89+
t.compile_fail_inline_check_sub(&format!("test_{index}"), &output, err);
9090
}
9191
}

glib/src/gstring_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ mod tests {
248248
#[test]
249249
fn display() {
250250
let s: crate::GStringBuilder = crate::GStringBuilder::new("This is a string.");
251-
assert_eq!(&format!("{}", s), "This is a string.");
251+
assert_eq!(&format!("{s}"), "This is a string.");
252252
}
253253

254254
#[test]

glib/tests/check_gir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
#[test]
44
fn check_gir_file() {
55
let res = gir_format_check::check_gir_file("Gir.toml");
6-
println!("{}", res);
6+
println!("{res}");
77
assert_eq!(res.nb_errors, 0);
88
}

glib/tests/clone.rs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn subfields_renaming() {
4848
let state = Rc::new(RefCell::new(State::new()));
4949

5050
let closure = clone!(@strong self.v as v, @weak state as hello => move |_| {
51-
println!("v: {}", v);
51+
println!("v: {v}");
5252
hello.borrow_mut().started = true;
5353
});
5454
closure(2);
@@ -182,29 +182,29 @@ fn test_clone_macro_self_rename() {
182182
#[allow(dead_code)]
183183
fn foo(&self) {
184184
let closure = clone!(@strong self as this => move |_x| {
185-
println!("v: {:?}", this);
185+
println!("v: {this:?}");
186186
});
187187
closure(0i8); // to prevent compiler error for unknown `x` type.
188188
let _ = clone!(@strong self as this => move || {
189-
println!("v: {:?}", this);
189+
println!("v: {this:?}");
190190
});
191-
let closure = clone!(@strong self as this => move |_x| println!("v: {:?}", this));
191+
let closure = clone!(@strong self as this => move |_x| println!("v: {this:?}"));
192192
closure(0i8); // to prevent compiler error for unknown `x` type.
193-
let _ = clone!(@strong self as this => move || println!("v: {:?}", this));
193+
let _ = clone!(@strong self as this => move || println!("v: {this:?}"));
194194

195195
// Fields now!
196196
let closure = clone!(@strong self.v as v => move |_x| {
197-
println!("v: {:?}", v);
197+
println!("v: {v:?}");
198198
});
199199
closure(0i8); // to prevent compiler error for unknown `x` type.
200-
let _ = clone!(@strong self.v as v => move || println!("v: {:?}", v));
200+
let _ = clone!(@strong self.v as v => move || println!("v: {v:?}"));
201201

202202
// With @default-panic
203203
let closure = clone!(@strong self.v as v => @default-panic, move |_x| {
204-
println!("v: {:?}", v);
204+
println!("v: {v:?}");
205205
});
206206
closure(0i8); // to prevent compiler error for unknown `x` type.
207-
let _ = clone!(@strong self.v as v => @default-panic, move || println!("v: {:?}", v));
207+
let _ = clone!(@strong self.v as v => @default-panic, move || println!("v: {v:?}"));
208208

209209
// With @default-return
210210
let closure = clone!(@strong self.v as _v => @default-return true, move |_x| {
@@ -221,28 +221,28 @@ fn test_clone_macro_rename() {
221221
let v = Rc::new(1);
222222

223223
let closure = clone!(@weak v as y => @default-panic, move |_x| {
224-
println!("v: {}", y);
224+
println!("v: {y}");
225225
});
226226
closure(0i8); // to prevent compiler error for unknown `x` type.
227-
let _ = clone!(@weak v as y => @default-panic, move || println!("v: {}", y));
227+
let _ = clone!(@weak v as y => @default-panic, move || println!("v: {y}"));
228228

229229
let closure = clone!(@strong v as y => @default-panic, move |_x| {
230-
println!("v: {}", y);
230+
println!("v: {y}");
231231
});
232232
closure(0i8); // to prevent compiler error for unknown `x` type.
233-
let _ = clone!(@strong v as y => @default-panic, move || println!("v: {}", y));
233+
let _ = clone!(@strong v as y => @default-panic, move || println!("v: {y}"));
234234

235235
let closure = clone!(@weak v as y => move |_x| {
236-
println!("v: {}", y);
236+
println!("v: {y}");
237237
});
238238
closure(0i8); // to prevent compiler error for unknown `x` type.
239-
let _ = clone!(@weak v as y => move || println!("v: {}", y));
239+
let _ = clone!(@weak v as y => move || println!("v: {y}"));
240240

241241
let closure = clone!(@strong v as y => move |_x| {
242-
println!("v: {}", y);
242+
println!("v: {y}");
243243
});
244244
closure(0i8); // to prevent compiler error for unknown `x` type.
245-
let _ = clone!(@strong v as y => move || println!("v: {}", y));
245+
let _ = clone!(@strong v as y => move || println!("v: {y}"));
246246

247247
let closure = clone!(@weak v as _y => @default-return true, move |_x| {
248248
false
@@ -260,28 +260,28 @@ fn test_clone_macro_simple() {
260260
let v = Rc::new(1);
261261

262262
let closure = clone!(@weak v => @default-panic, move |_x| {
263-
println!("v: {}", v);
263+
println!("v: {v}");
264264
});
265265
closure(0i8); // to prevent compiler error for unknown `x` type.
266-
let _ = clone!(@weak v => @default-panic, move || println!("v: {}", v));
266+
let _ = clone!(@weak v => @default-panic, move || println!("v: {v}"));
267267

268268
let closure = clone!(@strong v => @default-panic, move |_x| {
269-
println!("v: {}", v);
269+
println!("v: {v}");
270270
});
271271
closure(0i8); // to prevent compiler error for unknown `x` type.
272-
let _ = clone!(@strong v => @default-panic, move || println!("v: {}", v));
272+
let _ = clone!(@strong v => @default-panic, move || println!("v: {v}"));
273273

274274
let closure = clone!(@weak v => move |_x| {
275-
println!("v: {}", v);
275+
println!("v: {v}");
276276
});
277277
closure(0i8); // to prevent compiler error for unknown `x` type.
278-
let _ = clone!(@weak v => move || println!("v: {}", v));
278+
let _ = clone!(@weak v => move || println!("v: {v}"));
279279

280280
let closure = clone!(@strong v => move |_x| {
281-
println!("v: {}", v);
281+
println!("v: {v}");
282282
});
283283
closure(0i8); // to prevent compiler error for unknown `x` type.
284-
let _ = clone!(@strong v => move || println!("v: {}", v));
284+
let _ = clone!(@strong v => move || println!("v: {v}"));
285285

286286
let closure = clone!(@weak v => @default-return true, move |_x| {
287287
false
@@ -300,28 +300,28 @@ fn test_clone_macro_double_simple() {
300300
let w = Rc::new(2);
301301

302302
let closure = clone!(@weak v, @weak w => @default-panic, move |_x| {
303-
println!("v: {}, w: {}", v, w);
303+
println!("v: {v}, w: {w}");
304304
});
305305
closure(0i8); // to prevent compiler error for unknown `x` type.
306-
let _ = clone!(@weak v, @weak w => @default-panic, move || println!("v: {}, w: {}", v, w));
306+
let _ = clone!(@weak v, @weak w => @default-panic, move || println!("v: {v}, w: {w}"));
307307

308308
let closure = clone!(@strong v, @strong w => @default-panic, move |_x| {
309-
println!("v: {}, w: {}", v, w);
309+
println!("v: {v}, w: {w}");
310310
});
311311
closure(0i8); // to prevent compiler error for unknown `x` type.
312-
let _ = clone!(@strong v, @strong w => @default-panic, move || println!("v: {}, w: {}", v, w));
312+
let _ = clone!(@strong v, @strong w => @default-panic, move || println!("v: {v}, w: {w}"));
313313

314314
let closure = clone!(@weak v, @weak w => move |_x| {
315-
println!("v: {}, w: {}", v, w);
315+
println!("v: {v}, w: {w}");
316316
});
317317
closure(0i8); // to prevent compiler error for unknown `x` type.
318-
let _ = clone!(@weak v, @weak w => move || println!("v: {}, w: {}", v, w));
318+
let _ = clone!(@weak v, @weak w => move || println!("v: {v}, w: {w}"));
319319

320320
let closure = clone!(@strong v, @strong w => move |_x| {
321-
println!("v: {}, w: {}", v, w);
321+
println!("v: {v}, w: {w}");
322322
});
323323
closure(0i8); // to prevent compiler error for unknown `x` type.
324-
let _ = clone!(@strong v, @strong w => move || println!("v: {}, w: {}", v, w));
324+
let _ = clone!(@strong v, @strong w => move || println!("v: {v}, w: {w}"));
325325

326326
let closure = clone!(@weak v, @weak w => @default-return true, move |_x| {
327327
false

glib/tests/structured_log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn structured_log() {
1616
.map(|f| {
1717
let value = if let Some(data) = f.user_data() {
1818
assert!(f.value_str().is_none());
19-
format!("USERDATA: {}", data)
19+
format!("USERDATA: {data}")
2020
} else {
2121
f.value_str().unwrap().to_owned()
2222
};

graphene/tests/check_gir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
#[test]
44
fn check_gir_file() {
55
let res = gir_format_check::check_gir_file("Gir.toml");
6-
println!("{}", res);
6+
println!("{res}");
77
assert_eq!(res.nb_errors, 0);
88
}

pango/src/glyph_string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ mod tests {
7373
s.log_clusters_mut()[i] = i as i32;
7474
}
7575
let widths = s.logical_widths(TXT, false);
76-
println!("{:?}", widths);
76+
println!("{widths:?}");
7777
}
7878
}

pango/tests/check_gir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
#[test]
44
fn check_gir_file() {
55
let res = gir_format_check::check_gir_file("Gir.toml");
6-
println!("{}", res);
6+
println!("{res}");
77
assert_eq!(res.nb_errors, 0);
88
}

0 commit comments

Comments
 (0)