From 7adb0b1b94fd040751ec21ad9c8eff05a91e28cd Mon Sep 17 00:00:00 2001 From: Will Date: Mon, 9 Sep 2024 06:58:00 -0700 Subject: [PATCH] Bump bitflags and libloading to next major version (#203) * Bump bitflags from 1 -> 2. * Bump libloading from version 0.7 -> 0.8 --- Cargo.toml | 2 +- jack-sys/Cargo.toml | 4 ++-- src/client/client_impl.rs | 2 +- src/client/client_status.rs | 1 + src/port/port_flags.rs | 1 + src/port/test_port.rs | 9 +++++++-- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b1e56189d..86c6508b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/RustAudio/rust-jack" version = "0.12.1" [dependencies] -bitflags = "1" +bitflags = "2" jack-sys = {version = "0.5", path = "./jack-sys"} lazy_static = "1.4" libc = "0.2" diff --git a/jack-sys/Cargo.toml b/jack-sys/Cargo.toml index 9902b913a..2bcee51d3 100644 --- a/jack-sys/Cargo.toml +++ b/jack-sys/Cargo.toml @@ -11,11 +11,11 @@ version = "0.5.1" [dependencies] lazy_static = "1.4" libc = "0.2" -libloading = "0.7" +libloading = "0.8" log = "0.4" [build-dependencies] -bitflags = "1" +bitflags = "2" pkg-config = "0.3" [features] diff --git a/src/client/client_impl.rs b/src/client/client_impl.rs index 609a3a247..173b8b415 100644 --- a/src/client/client_impl.rs +++ b/src/client/client_impl.rs @@ -400,7 +400,7 @@ impl Client { Some(s) => s, None => return Err(Error::WeakFunctionNotFound("jack_internal_client_unload")), }; - ClientStatus::from_bits_unchecked(status) + ClientStatus::from_bits_retain(status) }; if status.is_empty() { Ok(()) diff --git a/src/client/client_status.rs b/src/client/client_status.rs index 0a8f5430b..5caa7eafe 100644 --- a/src/client/client_status.rs +++ b/src/client/client_status.rs @@ -3,6 +3,7 @@ use jack_sys as j; bitflags! { /// Status flags for JACK clients. + #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct ClientStatus: j::Enum_JackStatus { /// Overall operation failed. File an issue if you can get it to appear. const FAILURE = j::JackFailure; diff --git a/src/port/port_flags.rs b/src/port/port_flags.rs index b360f9f9f..a913dbfcf 100644 --- a/src/port/port_flags.rs +++ b/src/port/port_flags.rs @@ -3,6 +3,7 @@ use jack_sys as j; bitflags! { /// Flags for specifying port options. + #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct PortFlags: j::Enum_JackPortFlags { /// The port can receive data. const IS_INPUT = j::JackPortIsInput; diff --git a/src/port/test_port.rs b/src/port/test_port.rs index c68945387..6b80602c8 100644 --- a/src/port/test_port.rs +++ b/src/port/test_port.rs @@ -178,11 +178,16 @@ fn port_debug_printing() { ("name", "Ok(\"port_has_debug_string:debug_info\")"), ("connections", "0"), ("port_type", "Ok(\"32 bit float mono audio\")"), - ("port_flags", "IS_INPUT"), + ("port_flags", "PortFlags(IS_INPUT)"), ("aliases", "[\"this_port_alias\""), ]; for &(k, v) in parts.iter() { let p = format!("{k}: {v}"); - assert!(got.contains(&p)); + assert!( + got.contains(&p), + "Output:\n{}\nDoes not contain:\n\t{}", + got, + p + ); } }