Skip to content

Commit 8f989cc

Browse files
Merge pull request #823 from GuillaumeGomez/clippy-lints
Fix new clippy lints
2 parents 0dc4bd3 + b821180 commit 8f989cc

File tree

32 files changed

+120
-144
lines changed

32 files changed

+120
-144
lines changed

gdk-pixbuf/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 818f714dc796)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
1+
Generated by gir (https://github.com/gtk-rs/gir @ e94fdc6499e4)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 3b6fe0a33676)

gdk-pixbuf/sys/tests/abi.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Compiler {
4040
cmd.arg(out);
4141
let status = cmd.spawn()?.wait()?;
4242
if !status.success() {
43-
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
43+
return Err(format!("compilation command {cmd:?} failed, {status}").into());
4444
}
4545
Ok(())
4646
}
@@ -56,7 +56,7 @@ fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
5656
match env::var(name) {
5757
Ok(value) => Ok(shell_words::split(&value)?),
5858
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
59-
Err(err) => Err(format!("{} {}", name, err).into()),
59+
Err(err) => Err(format!("{name} {err}").into()),
6060
}
6161
}
6262

@@ -70,7 +70,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
7070
cmd.args(packages);
7171
let out = cmd.output()?;
7272
if !out.status.success() {
73-
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
73+
return Err(format!("command {cmd:?} returned {}", out.status).into());
7474
}
7575
let stdout = str::from_utf8(&out.stdout)?;
7676
Ok(shell_words::split(stdout.trim())?)
@@ -126,15 +126,14 @@ fn cross_validate_constants_with_c() {
126126
{
127127
if rust_name != c_name {
128128
results.record_failed();
129-
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
129+
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
130130
continue;
131131
}
132132

133133
if rust_value != c_value {
134134
results.record_failed();
135135
eprintln!(
136-
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
137-
rust_name, rust_value, &c_value
136+
"Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}",
138137
);
139138
continue;
140139
}
@@ -164,16 +163,13 @@ fn cross_validate_layout_with_c() {
164163
{
165164
if rust_name != c_name {
166165
results.record_failed();
167-
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
166+
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
168167
continue;
169168
}
170169

171170
if rust_layout != c_layout {
172171
results.record_failed();
173-
eprintln!(
174-
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
175-
rust_name, rust_layout, &c_layout
176-
);
172+
eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",);
177173
continue;
178174
}
179175

@@ -194,7 +190,7 @@ fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
194190
let mut abi_cmd = Command::new(exe);
195191
let output = abi_cmd.output()?;
196192
if !output.status.success() {
197-
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
193+
return Err(format!("command {abi_cmd:?} failed, {output:?}").into());
198194
}
199195

200196
Ok(String::from_utf8(output.stdout)?)

gdk-pixbuf/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 818f714dc796)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
1+
Generated by gir (https://github.com/gtk-rs/gir @ e94fdc6499e4)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 3b6fe0a33676)

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/src/auto/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 818f714dc796)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
1+
Generated by gir (https://github.com/gtk-rs/gir @ e94fdc6499e4)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 3b6fe0a33676)

gio/sys/tests/abi.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Compiler {
4040
cmd.arg(out);
4141
let status = cmd.spawn()?.wait()?;
4242
if !status.success() {
43-
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
43+
return Err(format!("compilation command {cmd:?} failed, {status}").into());
4444
}
4545
Ok(())
4646
}
@@ -56,7 +56,7 @@ fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
5656
match env::var(name) {
5757
Ok(value) => Ok(shell_words::split(&value)?),
5858
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
59-
Err(err) => Err(format!("{} {}", name, err).into()),
59+
Err(err) => Err(format!("{name} {err}").into()),
6060
}
6161
}
6262

@@ -70,7 +70,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
7070
cmd.args(packages);
7171
let out = cmd.output()?;
7272
if !out.status.success() {
73-
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
73+
return Err(format!("command {cmd:?} returned {}", out.status).into());
7474
}
7575
let stdout = str::from_utf8(&out.stdout)?;
7676
Ok(shell_words::split(stdout.trim())?)
@@ -126,15 +126,14 @@ fn cross_validate_constants_with_c() {
126126
{
127127
if rust_name != c_name {
128128
results.record_failed();
129-
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
129+
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
130130
continue;
131131
}
132132

133133
if rust_value != c_value {
134134
results.record_failed();
135135
eprintln!(
136-
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
137-
rust_name, rust_value, &c_value
136+
"Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}",
138137
);
139138
continue;
140139
}
@@ -164,16 +163,13 @@ fn cross_validate_layout_with_c() {
164163
{
165164
if rust_name != c_name {
166165
results.record_failed();
167-
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
166+
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
168167
continue;
169168
}
170169

171170
if rust_layout != c_layout {
172171
results.record_failed();
173-
eprintln!(
174-
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
175-
rust_name, rust_layout, &c_layout
176-
);
172+
eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",);
177173
continue;
178174
}
179175

@@ -194,7 +190,7 @@ fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
194190
let mut abi_cmd = Command::new(exe);
195191
let output = abi_cmd.output()?;
196192
if !output.status.success() {
197-
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
193+
return Err(format!("command {abi_cmd:?} failed, {output:?}").into());
198194
}
199195

200196
Ok(String::from_utf8(output.stdout)?)

gio/sys/versions.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Generated by gir (https://github.com/gtk-rs/gir @ 818f714dc796)
2-
from gir-files (https://github.com/gtk-rs/gir-files @ 89a11aa6a362)
1+
Generated by gir (https://github.com/gtk-rs/gir @ e94fdc6499e4)
2+
from gir-files (https://github.com/gtk-rs/gir-files @ 3b6fe0a33676)

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
}

gir

0 commit comments

Comments
 (0)