From 2288964f3be29348b6fc20c4f4bffabb72fd74c0 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Sat, 6 Jan 2024 22:08:50 +0100 Subject: [PATCH] Update to bitflags 2 --- Cargo.toml | 2 +- src/unix.rs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4a408b0..c7feee4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ rstest = "0.13" log = "0.4" cfg-if = "1" rustversion = "1" -bitflags = "1" +bitflags = "2" [target.'cfg(any(target_os = "linux", target_os = "android", target_os = "macos", target_os = "ios", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies] libc = ">=0.2.123" diff --git a/src/unix.rs b/src/unix.rs index aaa5170..26f8944 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -128,6 +128,7 @@ impl ScheduleParams { bitflags::bitflags! { /// Flags for controlling Deadline scheduling behavior. #[repr(transparent)] + #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct DeadlineFlags: u64 { /// Children created by [`libc::fork`] will not inherit privileged /// scheduling policies. @@ -141,13 +142,6 @@ bitflags::bitflags! { } } -#[cfg(any(target_os = "linux", target_os = "android"))] -impl Default for DeadlineFlags { - fn default() -> Self { - Self::empty() - } -} - /// Returns scheduling attributes for the current thread. #[cfg(any(target_os = "linux", target_os = "android"))] pub fn get_thread_scheduling_attributes() -> Result {