Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ fn main() {
if rustc_minor_ver >= 80 {
for cfg in ALLOWED_CFGS {
if rustc_minor_ver >= 75 {
println!("cargo:rustc-check-cfg=cfg({})", cfg);
println!("cargo:rustc-check-cfg=cfg({cfg})");
} else {
println!("cargo:rustc-check-cfg=values({})", cfg);
println!("cargo:rustc-check-cfg=values({cfg})");
}
}
for &(name, values) in CHECK_CFG_EXTRA {
let values = values.join("\",\"");
if rustc_minor_ver >= 75 {
println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values);
println!("cargo:rustc-check-cfg=cfg({name},values(\"{values}\"))");
} else {
println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
println!("cargo:rustc-check-cfg=values({name},\"{values}\")");
}
}
}
Expand Down Expand Up @@ -255,7 +255,7 @@ fn emcc_version_code() -> Option<u64> {

fn set_cfg(cfg: &str) {
if !ALLOWED_CFGS.contains(&cfg) {
panic!("trying to set cfg {}, but it is not in ALLOWED_CFGS", cfg);
panic!("trying to set cfg {cfg}, but it is not in ALLOWED_CFGS");
}
println!("cargo:rustc-cfg={}", cfg);
println!("cargo:rustc-cfg={cfg}");
}
4 changes: 2 additions & 2 deletions ci/ios/deploy_and_run_on_ios_simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::process::Command;
macro_rules! t {
($e:expr) => (match $e {
Ok(e) => e,
Err(e) => panic!("{} failed with: {}", stringify!($e), e),
Err(e) => panic!("{} failed with: {e}", stringify!($e)),
})
}

Expand Down Expand Up @@ -143,7 +143,7 @@ trait CheckStatus {

impl CheckStatus for Command {
fn check_status(&mut self) {
println!("\trunning: {:?}", self);
println!("\trunning: {self:?}");
assert!(t!(self.status()).success());
}
}
Expand Down
4 changes: 2 additions & 2 deletions ci/runtest-android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ fn main() {
let stderr = String::from_utf8_lossy(&output.stderr);

println!(
"status: {}\nstdout ---\n{}\nstderr ---\n{}",
output.status, stdout, stderr
"status: {}\nstdout ---\n{stdout}\nstderr ---\n{stderr}",
output.status,
);

if !stderr.lines().any(|l| {
Expand Down
16 changes: 8 additions & 8 deletions ctest-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ fn main() {
.type_name(move |ty, is_struct, is_union| match ty {
"T1Union" => ty.to_string(),
"Transparent" => ty.to_string(),
t if is_struct => format!("struct {}", t),
t if is_union => format!("union {}", t),
t if is_struct => format!("struct {t}"),
t if is_union => format!("union {t}"),
t => t.to_string(),
})
.volatile_item(t1_volatile)
Expand All @@ -43,8 +43,8 @@ fn main() {
.include("src")
.type_name(move |ty, is_struct, is_union| match ty {
"T2Union" => ty.to_string(),
t if is_struct => format!("struct {}", t),
t if is_union => format!("union {}", t),
t if is_struct => format!("struct {t}"),
t if is_union => format!("union {t}"),
t => t.to_string(),
})
.skip_roundtrip(|_| true)
Expand All @@ -64,8 +64,8 @@ fn main() {
.type_name(move |ty, is_struct, is_union| match ty {
"T1Union" => ty.to_string(),
"Transparent" => ty.to_string(),
t if is_struct => format!("struct {}", t),
t if is_union => format!("union {}", t),
t if is_struct => format!("struct {t}"),
t if is_union => format!("union {t}"),
t => t.to_string(),
})
.volatile_item(t1_volatile)
Expand All @@ -78,8 +78,8 @@ fn main() {
.include("src")
.type_name(move |ty, is_struct, is_union| match ty {
"T2Union" => ty.to_string(),
t if is_struct => format!("struct {}", t),
t if is_union => format!("union {}", t),
t if is_struct => format!("struct {t}"),
t if is_union => format!("union {t}"),
t => t.to_string(),
})
.skip_roundtrip(|_| true)
Expand Down
18 changes: 9 additions & 9 deletions ctest-test/tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ fn output(cmd: &mut Command) -> (String, ExitStatus) {
fn t1() {
let (o, status) = output(&mut cmd("t1"));
assert!(status.success(), "output: {o}");
assert!(!o.contains("bad "), "{}", o);
eprintln!("o: {}", o);
assert!(!o.contains("bad "), "{o}");
eprintln!("o: {o}");
}

#[test]
#[cfg(has_cxx)]
fn t1_cxx() {
let (o, status) = output(&mut cmd("t1_cxx"));
assert!(status.success(), "output: {o}");
assert!(!o.contains("bad "), "{}", o);
assert!(!o.contains("bad "), "{o}");
}

#[test]
Expand Down Expand Up @@ -69,17 +69,17 @@ fn t2() {
for line in o.lines().filter(|l| l.starts_with("bad ")) {
let msg = &line[..line.find(":").unwrap()];
if !errors.remove(&msg) {
println!("unknown error: {}", msg);
println!("unknown error: {msg}");
bad = true;
}
}

for error in errors {
println!("didn't find error: {}", error);
println!("didn't find error: {error}");
bad = true;
}
if bad {
println!("output was:\n\n{}", o);
println!("output was:\n\n{o}");
panic!();
}
}
Expand Down Expand Up @@ -114,17 +114,17 @@ fn t2_cxx() {
for line in o.lines().filter(|l| l.starts_with("bad ")) {
let msg = &line[..line.find(":").unwrap()];
if !errors.remove(&msg) {
println!("unknown error: {}", msg);
println!("unknown error: {msg}");
bad = true;
}
}

for error in errors {
println!("didn't find error: {}", error);
println!("didn't find error: {error}");
bad = true;
}
if bad {
println!("output was:\n\n{}", o);
println!("output was:\n\n{o}");
panic!();
}
}
Loading
Loading