From c0f0b69dd8c9960a83852b73ddc01183a480d73a Mon Sep 17 00:00:00 2001 From: Laurent Pelecq Date: Fri, 18 Mar 2022 00:17:24 +0100 Subject: [PATCH] Don't reexport Source --- src/async_mio.rs | 3 ++- src/client.rs | 9 ++++++++- src/types.rs | 7 ------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/async_mio.rs b/src/async_mio.rs index e44bdbc..4a48045 100644 --- a/src/async_mio.rs +++ b/src/async_mio.rs @@ -7,13 +7,14 @@ // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. +use mio::event::Source; use std::collections::VecDeque; use std::io::{self, Read, Write}; use crate::{ client::{Client, ClientError, ClientName, ClientResult}, constants::*, - types::{EventId, Source, SynthesisVoice}, + types::{EventId, SynthesisVoice}, }; #[derive(Debug)] diff --git a/src/client.rs b/src/client.rs index 94e1daf..fa63b2f 100644 --- a/src/client.rs +++ b/src/client.rs @@ -15,9 +15,16 @@ use crate::constants::*; use crate::protocol::{send_lines, write_lines}; use crate::types::{ CapitalLettersRecognitionMode, ClientScope, Event, KeyName, MessageId, MessageScope, - NotificationType, Priority, PunctuationMode, ReturnCode, Source, StatusLine, SynthesisVoice, + NotificationType, Priority, PunctuationMode, ReturnCode, StatusLine, SynthesisVoice, }; +// Trick to have common implementation for std and mio streams.. +#[cfg(not(feature = "async-mio"))] +use std::fmt::Debug as Source; + +#[cfg(feature = "async-mio")] +use mio::event::Source; + /// Client error, either I/O error or SSIP error. #[derive(ThisError, Debug)] pub enum ClientError { diff --git a/src/types.rs b/src/types.rs index 05509b1..42b46b9 100644 --- a/src/types.rs +++ b/src/types.rs @@ -378,13 +378,6 @@ impl fmt::Display for StatusLine { } } -#[cfg(not(feature = "async-mio"))] -// Trick to have common implementation for std and mio streams.. -pub use std::fmt::Debug as Source; - -#[cfg(feature = "async-mio")] -pub use mio::event::Source; - #[cfg(test)] mod tests {