Re-export `core2::io` or `std::io` depending on feature flags 2022-05-pub-io
authorMatt Corallo <git@bluematt.me>
Mon, 30 May 2022 17:50:02 +0000 (17:50 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 31 May 2022 00:17:40 +0000 (00:17 +0000)
This is useful in bindings as the `lightning::io` module is used in
the public interface, but also useful for users who want to refer
to the `io` as used in lightning irrespective of the feature flags.

lightning/src/lib.rs

index 3f88a208e9d00da1976fafd6e42fbbf6c6ace030..ba6d6bc71910e53ad37236dc30b6e19cd947a4d9 100644 (file)
@@ -78,9 +78,11 @@ pub mod ln;
 pub mod routing;
 
 #[cfg(feature = "std")]
-use std::io;
+/// Re-export of either `core2::io` or `std::io`, depending on the `std` feature flag.
+pub use std::io;
 #[cfg(not(feature = "std"))]
-use core2::io;
+/// Re-export of either `core2::io` or `std::io`, depending on the `std` feature flag.
+pub use core2::io;
 
 #[cfg(not(feature = "std"))]
 mod io_extras {