aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-01-04 19:45:28 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-01-04 19:45:28 +0900
commitee5b2548e2613ded3eef00200f6557b1a0567b58 (patch)
treef1282fca806654e23408448aea403ddecad483f9
parent30b9ee5677255a32b6ce101593bd756867156845 (diff)
downloadhinawa-rs-ee5b2548e2613ded3eef00200f6557b1a0567b58.tar.gz
hinawa-sys: regenerate sys crate
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r--README.rst2
-rw-r--r--hinawa/sys/Cargo.toml15
-rw-r--r--hinawa/sys/README.md7
-rw-r--r--hinawa/sys/build.rs8
-rw-r--r--hinawa/sys/src/lib.rs20
-rw-r--r--hinawa/sys/tests/abi.rs49
-rw-r--r--hinawa/sys/versions.txt4
7 files changed, 42 insertions, 63 deletions
diff --git a/README.rst b/README.rst
index ed2b138..6752af7 100644
--- a/README.rst
+++ b/README.rst
@@ -51,7 +51,7 @@ Dependencies
* API crate (`hinawa`)
* ``libc`` >= 0.2
- * ``glib`` >= 0.15
+ * ``glib`` >= 0.18
* FFI crate (``hinawa-sys``)
Examples
diff --git a/hinawa/sys/Cargo.toml b/hinawa/sys/Cargo.toml
index e0901f4..c320244 100644
--- a/hinawa/sys/Cargo.toml
+++ b/hinawa/sys/Cargo.toml
@@ -15,8 +15,12 @@ keywords = ["ieee1394", "firewire", "linux", "glib", "ffi"]
license = "MIT"
readme = "README.md"
repository = "https://git.kernel.org/pub/scm/libs/ieee1394/hinawa-rs.git/"
+
[package.metadata.docs.rs]
-features = ["dox"]
+rustc-args = ["--cfg", "docsrs"]
+rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
+all-features = true
+
[package.metadata.system-deps.hinawa]
name = "hinawa"
version = "4.0"
@@ -26,24 +30,21 @@ name = "hinawa_sys"
[build-dependencies]
pkg-config = "0.3.7"
-# To avoid MSRV in cfg-expr against rustc 1.67.
-system-deps = "=6.0.4"
+system-deps = "6"
[dependencies]
libc = "0.2"
[dependencies.glib]
package = "glib-sys"
-version = "0.15"
+version = "0.18"
[dependencies.gobject]
package = "gobject-sys"
-version = "0.15"
+version = "0.18"
[dev-dependencies]
shell-words = "1.0.0"
tempfile = "3"
[features]
-# To suppress linking to C library when generating documentation.
-dox = []
diff --git a/hinawa/sys/README.md b/hinawa/sys/README.md
index fc5dfdd..2f3f25d 100644
--- a/hinawa/sys/README.md
+++ b/hinawa/sys/README.md
@@ -19,13 +19,6 @@ The hinawa-sys crate is released under [MIT license](https://spdx.org/licenses/M
The hinawa-sys crate depends on FFI crates provided by [gtk-rs project](https://gtk-rs.org/) for
type/object system, event loop, and dispacher.
-## Features
-
-* dox
-
- * Suppress detection of installed hinawa library. It's automatically enabled when generating
- documentation in docs.rs.
-
## Repository
The hinawa-sys crate is maintained by Takashi Sakamoto for upstream of Linux FireWire subsystem.
diff --git a/hinawa/sys/build.rs b/hinawa/sys/build.rs
index 2737436..1e095f1 100644
--- a/hinawa/sys/build.rs
+++ b/hinawa/sys/build.rs
@@ -3,16 +3,16 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
-#[cfg(not(feature = "dox"))]
+#[cfg(not(docsrs))]
use std::process;
-#[cfg(feature = "dox")]
+#[cfg(docsrs)]
fn main() {} // prevent linking libraries to avoid documentation failure
-#[cfg(not(feature = "dox"))]
+#[cfg(not(docsrs))]
fn main() {
if let Err(s) = system_deps::Config::new().probe() {
- println!("cargo:warning={}", s);
+ println!("cargo:warning={s}");
process::exit(1);
}
}
diff --git a/hinawa/sys/src/lib.rs b/hinawa/sys/src/lib.rs
index e3bbaa0..976994a 100644
--- a/hinawa/sys/src/lib.rs
+++ b/hinawa/sys/src/lib.rs
@@ -11,7 +11,7 @@
clippy::unreadable_literal,
clippy::upper_case_acronyms
)]
-#![cfg_attr(feature = "dox", feature(doc_cfg))]
+#![cfg_attr(docsrs, feature(doc_cfg))]
#[allow(unused_imports)]
use libc::{
@@ -93,7 +93,7 @@ pub struct HinawaCycleTime {
impl ::std::fmt::Debug for HinawaCycleTime {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaCycleTime @ {:p}", self))
+ f.debug_struct(&format!("HinawaCycleTime @ {self:p}"))
.finish()
}
}
@@ -108,7 +108,7 @@ pub struct HinawaFwFcpClass {
impl ::std::fmt::Debug for HinawaFwFcpClass {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaFwFcpClass @ {:p}", self))
+ f.debug_struct(&format!("HinawaFwFcpClass @ {self:p}"))
.field("parent_class", &self.parent_class)
.field("responded", &self.responded)
.finish()
@@ -125,7 +125,7 @@ pub struct HinawaFwNodeClass {
impl ::std::fmt::Debug for HinawaFwNodeClass {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaFwNodeClass @ {:p}", self))
+ f.debug_struct(&format!("HinawaFwNodeClass @ {self:p}"))
.field("parent_class", &self.parent_class)
.field("bus_update", &self.bus_update)
.field("disconnected", &self.disconnected)
@@ -144,7 +144,7 @@ pub struct HinawaFwReqClass {
impl ::std::fmt::Debug for HinawaFwReqClass {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaFwReqClass @ {:p}", self))
+ f.debug_struct(&format!("HinawaFwReqClass @ {self:p}"))
.field("parent_class", &self.parent_class)
.field("responded", &self.responded)
.finish()
@@ -173,7 +173,7 @@ pub struct HinawaFwRespClass {
impl ::std::fmt::Debug for HinawaFwRespClass {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaFwRespClass @ {:p}", self))
+ f.debug_struct(&format!("HinawaFwRespClass @ {self:p}"))
.field("parent_class", &self.parent_class)
.field("requested", &self.requested)
.finish()
@@ -189,7 +189,7 @@ pub struct HinawaFwFcp {
impl ::std::fmt::Debug for HinawaFwFcp {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaFwFcp @ {:p}", self))
+ f.debug_struct(&format!("HinawaFwFcp @ {self:p}"))
.field("parent_instance", &self.parent_instance)
.finish()
}
@@ -203,7 +203,7 @@ pub struct HinawaFwNode {
impl ::std::fmt::Debug for HinawaFwNode {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaFwNode @ {:p}", self))
+ f.debug_struct(&format!("HinawaFwNode @ {self:p}"))
.field("parent_instance", &self.parent_instance)
.finish()
}
@@ -217,7 +217,7 @@ pub struct HinawaFwReq {
impl ::std::fmt::Debug for HinawaFwReq {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaFwReq @ {:p}", self))
+ f.debug_struct(&format!("HinawaFwReq @ {self:p}"))
.field("parent_instance", &self.parent_instance)
.finish()
}
@@ -231,7 +231,7 @@ pub struct HinawaFwResp {
impl ::std::fmt::Debug for HinawaFwResp {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
- f.debug_struct(&format!("HinawaFwResp @ {:p}", self))
+ f.debug_struct(&format!("HinawaFwResp @ {self:p}"))
.field("parent_instance", &self.parent_instance)
.finish()
}
diff --git a/hinawa/sys/tests/abi.rs b/hinawa/sys/tests/abi.rs
index d2b12c7..e40e031 100644
--- a/hinawa/sys/tests/abi.rs
+++ b/hinawa/sys/tests/abi.rs
@@ -3,6 +3,8 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
+#![cfg(unix)]
+
use hinawa_sys::*;
use std::env;
use std::error::Error;
@@ -41,7 +43,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(())
}
@@ -57,7 +59,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()),
}
}
@@ -71,7 +73,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())?)
@@ -111,18 +113,12 @@ impl Results {
}
#[test]
-#[cfg(target_os = "linux")]
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();
@@ -132,15 +128,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;
}
@@ -152,22 +147,15 @@ fn cross_validate_constants_with_c() {
}
#[test]
-#[cfg(target_os = "linux")]
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();
@@ -176,16 +164,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;
}
@@ -206,7 +191,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)?)
diff --git a/hinawa/sys/versions.txt b/hinawa/sys/versions.txt
index 4bb7a0b..369e893 100644
--- a/hinawa/sys/versions.txt
+++ b/hinawa/sys/versions.txt
@@ -1,3 +1,3 @@
-Generated by gir (https://github.com/gtk-rs/gir @ c8a7a13d2c4d)
+Generated by gir (https://github.com/gtk-rs/gir @ 23d7c100187c)
from
-from gir-files (https://github.com/gtk-rs/gir-files @ faebfb303ca6)
+from gir-files (https://github.com/gtk-rs/gir-files @ 6415239ef435)