diff --git a/crates/anstream/src/auto.rs b/crates/anstream/src/auto.rs index 9dc56db8..fc5b5441 100644 --- a/crates/anstream/src/auto.rs +++ b/crates/anstream/src/auto.rs @@ -1,6 +1,6 @@ +use crate::stream::RawStream; #[cfg(feature = "auto")] use crate::ColorChoice; -use crate::RawStream; use crate::StripStream; #[cfg(all(windows, feature = "wincon"))] use crate::WinconStream; diff --git a/crates/anstream/src/buffer.rs b/crates/anstream/src/buffer.rs index 6f359283..f7347a52 100644 --- a/crates/anstream/src/buffer.rs +++ b/crates/anstream/src/buffer.rs @@ -1,6 +1,6 @@ -use crate::IsTerminal; +use crate::stream::IsTerminal; -/// In-memory [`RawStream`][crate::RawStream] +/// In-memory [`RawStream`][crate::stream::RawStream] #[derive(Clone, Default, Debug, PartialEq, Eq)] pub struct Buffer(Vec); diff --git a/crates/anstream/src/lib.rs b/crates/anstream/src/lib.rs index 230e73b3..91076d80 100644 --- a/crates/anstream/src/lib.rs +++ b/crates/anstream/src/lib.rs @@ -35,18 +35,17 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod adapter; +pub mod stream; + mod buffer; #[macro_use] mod macros; mod auto; -mod stream; mod strip; #[cfg(all(windows, feature = "wincon"))] mod wincon; pub use auto::AutoStream; -pub use stream::IsTerminal; -pub use stream::RawStream; pub use strip::StripStream; #[cfg(all(windows, feature = "wincon"))] pub use wincon::WinconStream; diff --git a/crates/anstream/src/stream.rs b/crates/anstream/src/stream.rs index 754c5b57..5ad5fa7f 100644 --- a/crates/anstream/src/stream.rs +++ b/crates/anstream/src/stream.rs @@ -1,3 +1,5 @@ +//! Higher-level traits to describe writeable streams + /// Required functionality for underlying [`std::io::Write`] for adaptation #[cfg(not(all(windows, feature = "wincon")))] pub trait RawStream: std::io::Write + IsTerminal + private::Sealed {} diff --git a/crates/anstream/src/strip.rs b/crates/anstream/src/strip.rs index 3d3c6cd0..6d781551 100644 --- a/crates/anstream/src/strip.rs +++ b/crates/anstream/src/strip.rs @@ -1,5 +1,5 @@ use crate::adapter::StripBytes; -use crate::RawStream; +use crate::stream::RawStream; /// Only pass printable data to the inner `Write` #[derive(Debug)] diff --git a/crates/anstream/src/wincon.rs b/crates/anstream/src/wincon.rs index 0e4f0d29..af6051ad 100644 --- a/crates/anstream/src/wincon.rs +++ b/crates/anstream/src/wincon.rs @@ -1,5 +1,5 @@ use crate::adapter::WinconBytes; -use crate::RawStream; +use crate::stream::RawStream; /// Only pass printable data to the inner `Write` #[cfg(feature = "wincon")] // here mostly for documentation purposes