diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2024-01-04 20:23:10 +0900 |
---|---|---|
committer | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2024-01-04 20:23:10 +0900 |
commit | 882aa08914c51864566fc2acc52bd71fe7eca600 (patch) | |
tree | 2a8b2ef94f401df57ec646f93ced090e2e647c09 | |
parent | 22e9a4cced0085084afe178335f69fe7dddf9478 (diff) | |
download | hinoko-rs-882aa08914c51864566fc2acc52bd71fe7eca600.tar.gz |
hinoko-sys: regenerate SYS crate
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r-- | README.rst | 4 | ||||
-rw-r--r-- | hinoko/Cargo.toml | 2 | ||||
-rw-r--r-- | hinoko/sys/Cargo.toml | 17 | ||||
-rw-r--r-- | hinoko/sys/README.md | 7 | ||||
-rw-r--r-- | hinoko/sys/build.rs | 8 | ||||
-rw-r--r-- | hinoko/sys/src/lib.rs | 30 | ||||
-rw-r--r-- | hinoko/sys/tests/abi.rs | 49 | ||||
-rw-r--r-- | hinoko/sys/versions.txt | 4 |
8 files changed, 50 insertions, 71 deletions
@@ -49,8 +49,8 @@ Dependencies * ``libc`` >= 0.2 * ``bitflags`` >= 1.0 - * ``glib`` >= 0.15 - * ``hinawa`` >= 0.9 + * ``glib`` >= 0.l8 + * ``hinawa`` >= 0.10 * FFI crate (``hinoko-sys``) Examples diff --git a/hinoko/Cargo.toml b/hinoko/Cargo.toml index 3a7a797..d0ccc6c 100644 --- a/hinoko/Cargo.toml +++ b/hinoko/Cargo.toml @@ -31,4 +31,4 @@ once_cell = "1.5" [features] # To suppress linking to C library to generate documentation. -dox = ["ffi/dox", "glib/dox", "hinawa/dox"] +dox = ["glib/dox", "hinawa/dox"] diff --git a/hinoko/sys/Cargo.toml b/hinoko/sys/Cargo.toml index 17dc37b..f9e0e88 100644 --- a/hinoko/sys/Cargo.toml +++ b/hinoko/sys/Cargo.toml @@ -14,8 +14,12 @@ homepage = "https://alsa-project.github.io/gobject-introspection-docs/" keywords = ["ieee1394", "firewire", "linux", "glib", "ffi"] license = "MIT" repository = "https://git.kernel.org/pub/scm/libs/ieee1394/hinoko-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.hinoko] name = "hinoko" version = "1.0.0" @@ -25,28 +29,25 @@ name = "hinoko_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" [dependencies.hinawa] package = "hinawa-sys" -version = "0.9" +version = "0.10" [dev-dependencies] shell-words = "1.0.0" tempfile = "3" [features] -# To suppress linking to C library to generate documentation. -dox = ["hinawa/dox"] diff --git a/hinoko/sys/README.md b/hinoko/sys/README.md index 59fcda9..feec00b 100644 --- a/hinoko/sys/README.md +++ b/hinoko/sys/README.md @@ -19,13 +19,6 @@ The hinoko-sys crate is released under [MIT license](https://spdx.org/licenses/M The hinoko-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 hinoko library. It's automatically enabled when generating - documentation in docs.rs. - ## Repository The hinoko-sys crate is maintained by Takashi Sakamoto for upstream of Linux FireWire subsystem. diff --git a/hinoko/sys/build.rs b/hinoko/sys/build.rs index 2737436..1e095f1 100644 --- a/hinoko/sys/build.rs +++ b/hinoko/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/hinoko/sys/src/lib.rs b/hinoko/sys/src/lib.rs index 00fb3f3..b5b7bb9 100644 --- a/hinoko/sys/src/lib.rs +++ b/hinoko/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::{ @@ -94,7 +94,7 @@ pub struct HinokoFwIsoCtxInterface { impl ::std::fmt::Debug for HinokoFwIsoCtxInterface { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoCtxInterface @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoCtxInterface @ {self:p}")) .field("parent_iface", &self.parent_iface) .field("stop", &self.stop) .field("unmap_buffer", &self.unmap_buffer) @@ -116,7 +116,7 @@ pub struct HinokoFwIsoIrMultipleClass { impl ::std::fmt::Debug for HinokoFwIsoIrMultipleClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoIrMultipleClass @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoIrMultipleClass @ {self:p}")) .field("parent_class", &self.parent_class) .field("interrupted", &self.interrupted) .finish() @@ -134,7 +134,7 @@ pub struct HinokoFwIsoIrSingleClass { impl ::std::fmt::Debug for HinokoFwIsoIrSingleClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoIrSingleClass @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoIrSingleClass @ {self:p}")) .field("parent_class", &self.parent_class) .field("interrupted", &self.interrupted) .finish() @@ -151,7 +151,7 @@ pub struct HinokoFwIsoItClass { impl ::std::fmt::Debug for HinokoFwIsoItClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoItClass @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoItClass @ {self:p}")) .field("parent_class", &self.parent_class) .field("interrupted", &self.interrupted) .finish() @@ -166,7 +166,7 @@ pub struct HinokoFwIsoResourceAutoClass { impl ::std::fmt::Debug for HinokoFwIsoResourceAutoClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoResourceAutoClass @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoResourceAutoClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } @@ -208,7 +208,7 @@ pub struct HinokoFwIsoResourceInterface { impl ::std::fmt::Debug for HinokoFwIsoResourceInterface { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoResourceInterface @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoResourceInterface @ {self:p}")) .field("parent_iface", &self.parent_iface) .field("open", &self.open) .field("allocate", &self.allocate) @@ -227,7 +227,7 @@ pub struct HinokoFwIsoResourceOnceClass { impl ::std::fmt::Debug for HinokoFwIsoResourceOnceClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoResourceOnceClass @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoResourceOnceClass @ {self:p}")) .field("parent_class", &self.parent_class) .finish() } @@ -242,7 +242,7 @@ pub struct HinokoFwIsoIrMultiple { impl ::std::fmt::Debug for HinokoFwIsoIrMultiple { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoIrMultiple @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoIrMultiple @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } @@ -256,7 +256,7 @@ pub struct HinokoFwIsoIrSingle { impl ::std::fmt::Debug for HinokoFwIsoIrSingle { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoIrSingle @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoIrSingle @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } @@ -270,7 +270,7 @@ pub struct HinokoFwIsoIt { impl ::std::fmt::Debug for HinokoFwIsoIt { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoIt @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoIt @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } @@ -284,7 +284,7 @@ pub struct HinokoFwIsoResourceAuto { impl ::std::fmt::Debug for HinokoFwIsoResourceAuto { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoResourceAuto @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoResourceAuto @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } @@ -298,7 +298,7 @@ pub struct HinokoFwIsoResourceOnce { impl ::std::fmt::Debug for HinokoFwIsoResourceOnce { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("HinokoFwIsoResourceOnce @ {:p}", self)) + f.debug_struct(&format!("HinokoFwIsoResourceOnce @ {self:p}")) .field("parent_instance", &self.parent_instance) .finish() } @@ -313,7 +313,7 @@ pub struct HinokoFwIsoCtx { impl ::std::fmt::Debug for HinokoFwIsoCtx { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - write!(f, "HinokoFwIsoCtx @ {:p}", self) + write!(f, "HinokoFwIsoCtx @ {self:p}") } } @@ -325,7 +325,7 @@ pub struct HinokoFwIsoResource { impl ::std::fmt::Debug for HinokoFwIsoResource { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - write!(f, "HinokoFwIsoResource @ {:p}", self) + write!(f, "HinokoFwIsoResource @ {self:p}") } } diff --git a/hinoko/sys/tests/abi.rs b/hinoko/sys/tests/abi.rs index 5a571a4..660b646 100644 --- a/hinoko/sys/tests/abi.rs +++ b/hinoko/sys/tests/abi.rs @@ -3,6 +3,8 @@ // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT +#![cfg(unix)] + use hinoko_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/hinoko/sys/versions.txt b/hinoko/sys/versions.txt index 1313169..369e893 100644 --- a/hinoko/sys/versions.txt +++ b/hinoko/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 @ 7ebd4478b4a5) +from gir-files (https://github.com/gtk-rs/gir-files @ 6415239ef435) |