From de95de35c37427612d27873f23af051e9203679e Mon Sep 17 00:00:00 2001 From: quininer Date: Thu, 17 Oct 2024 22:20:46 +0800 Subject: [PATCH] impl ord,eq for bitflags --- .github/workflows/ci.yml | 2 ++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/types.rs | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6b40f6..deeb929 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable + - name: Test API + run: cargo test --target ${{ matrix.target }} - name: Test run: cargo run --package io-uring-test --features io-uring-test/ci --target ${{ matrix.target }} diff --git a/Cargo.lock b/Cargo.lock index f08d4ec..33516b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,7 +276,7 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "bindgen", diff --git a/Cargo.toml b/Cargo.toml index 387784d..115160b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "io-uring" -version = "0.7.0" +version = "0.7.1" authors = ["quininer "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/src/types.rs b/src/types.rs index b7a1d41..fc67feb 100644 --- a/src/types.rs +++ b/src/types.rs @@ -88,7 +88,7 @@ bitflags! { /// The default behavior when the timeout expires is to return a CQE with -libc::ETIME in /// the res field. To change this behavior to have zero returned, include /// [`types::TimeoutFlags::ETIME_SUCCESS`]. - #[derive(Debug, Clone, Copy)] + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct TimeoutFlags: u32 { const ABS = sys::IORING_TIMEOUT_ABS; @@ -104,7 +104,7 @@ bitflags! { bitflags! { /// Options for [`Fsync`](super::Fsync). - #[derive(Debug, Clone, Copy)] + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct FsyncFlags: u32 { const DATASYNC = sys::IORING_FSYNC_DATASYNC; } @@ -113,7 +113,7 @@ bitflags! { bitflags! { /// Options for [`AsyncCancel`](super::AsyncCancel) and /// [`Submitter::register_sync_cancel`](super::Submitter::register_sync_cancel). - #[derive(Debug, Clone, Copy)] + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub(crate) struct AsyncCancelFlags: u32 { /// Cancel all requests that match the given criteria, rather /// than just canceling the first one found.