refactor: move traits to sync module and update imports

This commit is contained in:
Callum Leslie 2026-03-04 20:58:17 +00:00
parent 72b87fd6e0
commit 8366421ede
7 changed files with 7 additions and 7 deletions

View file

@ -2,7 +2,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use crate::error::Error; use crate::error::Error;
use crate::traits::{ChannelReceiver, ChannelSender}; use crate::sync::traits::{ChannelReceiver, ChannelSender};
use crate::types::{ChannelState, Request, Response, ValueSource}; use crate::types::{ChannelState, Request, Response, ValueSource};
/// The consumer side of the channel that requests values /// The consumer side of the channel that requests values

View file

@ -6,8 +6,6 @@ pub mod async_channel;
#[cfg(feature = "sync")] #[cfg(feature = "sync")]
pub mod channel; pub mod channel;
pub mod error; pub mod error;
#[cfg(feature = "sync")]
pub mod traits;
#[cfg(feature = "async")] #[cfg(feature = "async")]
pub mod asynchronous; pub mod asynchronous;

View file

@ -1,7 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
#[cfg(feature = "sync-crossbeam")] #[cfg(feature = "sync-crossbeam")]
use crate::traits::{ChannelError, ChannelReceiver, ChannelSender, ChannelType}; use crate::sync::traits::{ChannelError, ChannelReceiver, ChannelSender, ChannelType};
use crate::types; use crate::types;
use arc_swap::ArcSwap; use arc_swap::ArcSwap;
use crossbeam_channel; use crossbeam_channel;

View file

@ -1,7 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
#[cfg(feature = "sync-flume")] #[cfg(feature = "sync-flume")]
use crate::traits::{ChannelError, ChannelReceiver, ChannelSender, ChannelType}; use crate::sync::traits::{ChannelError, ChannelReceiver, ChannelSender, ChannelType};
use crate::types; use crate::types;
use arc_swap::ArcSwap; use arc_swap::ArcSwap;
use flume; use flume;

View file

@ -1,3 +1,5 @@
pub mod traits;
#[cfg(feature = "sync-crossbeam")] #[cfg(feature = "sync-crossbeam")]
pub mod crossbeam; pub mod crossbeam;
#[cfg(feature = "sync-flume")] #[cfg(feature = "sync-flume")]

View file

@ -1,6 +1,6 @@
use arc_swap::ArcSwap; use arc_swap::ArcSwap;
use crate::traits::{ChannelError, ChannelReceiver, ChannelSender, ChannelType}; use crate::sync::traits::{ChannelError, ChannelReceiver, ChannelSender, ChannelType};
use crate::types; use crate::types;
use std::sync::Arc; use std::sync::Arc;
#[cfg(feature = "sync-std")] #[cfg(feature = "sync-std")]
@ -77,7 +77,7 @@ impl<T> StdSuck<T> {
mod tests { mod tests {
use super::*; use super::*;
use crate::Error; use crate::Error;
use crate::traits::ChannelType; use crate::sync::traits::ChannelType;
use std::thread; use std::thread;
#[derive(Debug)] #[derive(Debug)]