Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the core::io implementation to separate module
- Loading branch information
Showing
2 changed files
with
23 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//! A tiny, `no_std`-friendly facade around `std::io`. | ||
//! Reexports types from `std` when available; otherwise reimplements and | ||
//! provides some of the core logic. | ||
//! | ||
//! The main reason that `std::io` hasn't found itself reexported as part of | ||
//! the `core` crate is the `std::io::{Read, Write}` traits' reliance on | ||
//! `std::io::Error`, which may contain internally a heap-allocated `Box<Error>` | ||
//! and/or now relying on OS-specific `std::backtrace::Backtrace`. | ||
|
||
pub use self::imp::{Bytes, Error, ErrorKind, Read, Result, Write}; | ||
|
||
mod core; | ||
|
||
mod imp { | ||
#[cfg(not(feature = "std"))] | ||
pub use super::core::*; | ||
#[cfg(feature = "std")] | ||
pub use std::io::*; | ||
} |