Skip to content

Commit

Permalink
fix(stream)!: Sequester internal traits to stream mod
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Sep 28, 2023
1 parent 565425e commit 3238480
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/anstream/src/auto.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions crates/anstream/src/buffer.rs
Original file line number Diff line number Diff line change
@@ -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<u8>);

Expand Down
5 changes: 2 additions & 3 deletions crates/anstream/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions crates/anstream/src/stream.rs
Original file line number Diff line number Diff line change
@@ -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 {}
Expand Down
2 changes: 1 addition & 1 deletion crates/anstream/src/strip.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion crates/anstream/src/wincon.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3238480

Please sign in to comment.