rust: Update to gio 0.16
This was quite seamless; the only thing I had to tweak was adding `+ Send` bounds in the `Box<dyn Error>` manual checksum_async API.
This commit is contained in:
1 parent
9d652be3b1
commit
1a76f45fd7
38 files changed
+1145
-4020
No files matched your search
@@ -40,7 +40,7 @@ impl Compiler {
|
||||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
return Err(format!("compilation command {cmd:?} failed, {status}").into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -56,7 +56,7 @@ fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
|
||||
match env::var(name) {
|
||||
Ok(value) => Ok(shell_words::split(&value)?),
|
||||
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
|
||||
Err(err) => Err(format!("{} {}", name, err).into()),
|
||||
Err(err) => Err(format!("{name} {err}").into()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
|
||||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
|
||||
return Err(format!("command {cmd:?} returned {}", out.status).into());
|
||||
}
|
||||
let stdout = str::from_utf8(&out.stdout)?;
|
||||
Ok(shell_words::split(stdout.trim())?)
|
||||
@@ -115,13 +115,8 @@ fn cross_validate_constants_with_c() {
|
||||
let mut c_constants: Vec<(String, String)> = Vec::new();
|
||||
|
||||
for l in get_c_output("constant").unwrap().lines() {
|
||||
let mut words = l.trim().split(';');
|
||||
let name = words.next().expect("Failed to parse name").to_owned();
|
||||
let value = words
|
||||
.next()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.expect("Failed to parse value");
|
||||
c_constants.push((name, value));
|
||||
let (name, value) = l.split_once(';').expect("Missing ';' separator");
|
||||
c_constants.push((name.to_owned(), value.to_owned()));
|
||||
}
|
||||
|
||||
let mut results = Results::default();
|
||||
@@ -131,15 +126,14 @@ fn cross_validate_constants_with_c() {
|
||||
{
|
||||
if rust_name != c_name {
|
||||
results.record_failed();
|
||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
||||
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||
continue;
|
||||
}
|
||||
|
||||
if rust_value != c_value {
|
||||
results.record_failed();
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
rust_name, rust_value, &c_value
|
||||
"Constant value mismatch for {rust_name}\nRust: {rust_value:?}\nC: {c_value:?}",
|
||||
);
|
||||
continue;
|
||||
}
|
||||
@@ -156,17 +150,11 @@ fn cross_validate_layout_with_c() {
|
||||
let mut c_layouts = Vec::new();
|
||||
|
||||
for l in get_c_output("layout").unwrap().lines() {
|
||||
let mut words = l.trim().split(';');
|
||||
let name = words.next().expect("Failed to parse name").to_owned();
|
||||
let size = words
|
||||
.next()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.expect("Failed to parse size");
|
||||
let alignment = words
|
||||
.next()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.expect("Failed to parse alignment");
|
||||
c_layouts.push((name, Layout { size, alignment }));
|
||||
let (name, value) = l.split_once(';').expect("Missing first ';' separator");
|
||||
let (size, alignment) = value.split_once(';').expect("Missing second ';' separator");
|
||||
let size = size.parse().expect("Failed to parse size");
|
||||
let alignment = alignment.parse().expect("Failed to parse alignment");
|
||||
c_layouts.push((name.to_owned(), Layout { size, alignment }));
|
||||
}
|
||||
|
||||
let mut results = Results::default();
|
||||
@@ -175,16 +163,13 @@ fn cross_validate_layout_with_c() {
|
||||
{
|
||||
if rust_name != c_name {
|
||||
results.record_failed();
|
||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
||||
eprintln!("Name mismatch:\nRust: {rust_name:?}\nC: {c_name:?}");
|
||||
continue;
|
||||
}
|
||||
|
||||
if rust_layout != c_layout {
|
||||
results.record_failed();
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
rust_name, rust_layout, &c_layout
|
||||
);
|
||||
eprintln!("Layout mismatch for {rust_name}\nRust: {rust_layout:?}\nC: {c_layout:?}",);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -205,7 +190,7 @@ fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
|
||||
let mut abi_cmd = Command::new(exe);
|
||||
let output = abi_cmd.output()?;
|
||||
if !output.status.success() {
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
return Err(format!("command {abi_cmd:?} failed, {output:?}").into());
|
||||
}
|
||||
|
||||
Ok(String::from_utf8(output.stdout)?)
|
||||
|
||||
Reference in new issue
Block a user