From a8cc5d01fd3ca8a2dfb31a14aafa5398c3bcce5a Mon Sep 17 00:00:00 2001 From: Maxime Borges Date: Mon, 14 Oct 2024 20:43:36 +0200 Subject: [PATCH 1/2] Make mio pub That allows to refer to the exact version used by the library in our lib/app without having to include mio in our dependencies. --- src/lib.rs | 8 ++++---- src/monitor.rs | 8 ++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b92dd99..3e9b92e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,13 +8,13 @@ extern crate io_lifetimes; extern crate libc; pub extern crate libudev_sys as ffi; #[cfg(feature = "mio06")] -extern crate mio06; +pub extern crate mio06; #[cfg(feature = "mio07")] -extern crate mio07; +pub extern crate mio07 as mio; #[cfg(feature = "mio08")] -extern crate mio08; +pub extern crate mio08 as mio; #[cfg(feature = "mio10")] -extern crate mio10; +pub extern crate mio10 as mio; pub use device::{Attributes, Device, DeviceType, Properties}; pub use enumerator::{Devices, Enumerator}; diff --git a/src/monitor.rs b/src/monitor.rs index dd6513f..7748bd1 100644 --- a/src/monitor.rs +++ b/src/monitor.rs @@ -9,12 +9,8 @@ use std::os::unix::io::{AsRawFd, RawFd}; use io_lifetimes::{AsFd, BorrowedFd}; #[cfg(feature = "mio06")] use mio06::{event::Evented, unix::EventedFd, Poll, PollOpt, Ready, Token}; -#[cfg(feature = "mio07")] -use mio07::{event::Source, unix::SourceFd, Interest, Registry, Token}; -#[cfg(feature = "mio08")] -use mio08::{event::Source, unix::SourceFd, Interest, Registry, Token}; -#[cfg(feature = "mio10")] -use mio10::{event::Source, unix::SourceFd, Interest, Registry, Token}; +#[cfg(any(feature = "mio07", feature = "mio08", feature = "mio10"))] +use mio::{event::Source, unix::SourceFd, Interest, Registry, Token}; use Udev; use {ffi, util}; From 23bebc6fb65aac85460aa697209bdbf10e28799d Mon Sep 17 00:00:00 2001 From: Maxime Borges Date: Tue, 21 Jan 2025 13:50:21 +0100 Subject: [PATCH 2/2] udev: Export mio06 crate as mio --- src/lib.rs | 2 +- src/monitor.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3e9b92e..a32d35f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ extern crate io_lifetimes; extern crate libc; pub extern crate libudev_sys as ffi; #[cfg(feature = "mio06")] -pub extern crate mio06; +pub extern crate mio06 as mio; #[cfg(feature = "mio07")] pub extern crate mio07 as mio; #[cfg(feature = "mio08")] diff --git a/src/monitor.rs b/src/monitor.rs index 7748bd1..77366b3 100644 --- a/src/monitor.rs +++ b/src/monitor.rs @@ -8,7 +8,7 @@ use std::os::unix::io::{AsRawFd, RawFd}; use io_lifetimes::{AsFd, BorrowedFd}; #[cfg(feature = "mio06")] -use mio06::{event::Evented, unix::EventedFd, Poll, PollOpt, Ready, Token}; +use mio::{event::Evented, unix::EventedFd, Poll, PollOpt, Ready, Token}; #[cfg(any(feature = "mio07", feature = "mio08", feature = "mio10"))] use mio::{event::Source, unix::SourceFd, Interest, Registry, Token};