[IO] Move io module into selected re-exports
In the coming commits we'll move our `io` module to having its own implementations of the usual I/O traits and structs. Here we first move to re-exporting only exactly what we need, allowing us to whittle the list down from a fixed set.
This commit is contained in:
parent
27c7c4e26a
commit
a0ade883b6
|
@ -21,12 +21,25 @@
|
||||||
#[cfg(all(not(feature = "std"), not(feature = "core2")))]
|
#[cfg(all(not(feature = "std"), not(feature = "core2")))]
|
||||||
compile_error!("At least one of std or core2 must be enabled");
|
compile_error!("At least one of std or core2 must be enabled");
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
pub use std::io;
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub use std::error;
|
pub use std::error;
|
||||||
|
|
||||||
#[cfg(not(feature = "std"))]
|
|
||||||
pub use core2::io;
|
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "std"))]
|
||||||
pub use core2::error;
|
pub use core2::error;
|
||||||
|
|
||||||
|
#[cfg(any(feature = "alloc", feature = "std"))]
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
/// Standard I/O stream definitions which are API-equivalent to `std`'s `io` module. See
|
||||||
|
/// [`std::io`] for more info.
|
||||||
|
pub mod io {
|
||||||
|
#[cfg(all(not(feature = "std"), not(feature = "core2")))]
|
||||||
|
compile_error!("At least one of std or core2 must be enabled");
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
|
pub use std::io::{Read, Write, Cursor, Take, IoSlice, Error, ErrorKind, Result};
|
||||||
|
|
||||||
|
#[cfg(not(feature = "std"))]
|
||||||
|
pub use core2::io::{Read, Write, Cursor, Take, Error, ErrorKind, Result};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue