diff --git a/Cargo.toml b/Cargo.toml index d6d5cc0..f7e5b72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ async-executor = "0.1.1" async-io = "0.1.5" blocking = "0.5.0" easy-parallel = "3.1.0" -futures-lite = "0.1.8" +futures-lite = "0.1.9" num_cpus = "1.13.0" [dependencies.tokio] diff --git a/README.md b/README.md index 644813f..d79a368 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ Look inside the [examples] directory for more. All async libraries work with smol out of the box. -However, [tokio] is generally hostile towards non-tokio libraries, insists on non-standard I/O -traits, and deliberately lacks documentation on integration with the larger Rust ecosystem. +The only exception is [tokio], which is traditionally incompatible with [futures], breaks +when used with other executors, and lacks documentation on how to fix such errors. Fortunately, there are ways around it. Enable the `tokio02` feature flag and `smol::run()` will create a minimal @@ -60,6 +60,7 @@ smol = { version = "0.3", features = ["tokio02"] } ``` [tokio]: https://docs.rs/tokio +[futures]: https://docs.rs/futures ## TLS certificate diff --git a/src/lib.rs b/src/lib.rs index 214425a..b625fa6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,9 +34,8 @@ //! //! All async libraries work with smol out of the box. //! -//! However, [tokio] is generally hostile towards non-tokio libraries, insists on non-standard I/O -//! traits, and deliberately lacks documentation on integration with the larger Rust ecosystem. -//! Fortunately, there are ways around it. +//! The only exception is [tokio], which is traditionally incompatible with [futures] and crashes +//! when called from other executors. Fortunately, there are ways around it. //! //! Enable the `tokio02` feature flag and [`smol::run()`][`crate::run()`] will create a minimal //! tokio runtime for its libraries: @@ -47,6 +46,7 @@ //! ``` //! //! [tokio]: https://docs.rs/tokio +//! [futures]: https://docs.rs/futures #![forbid(unsafe_code)] #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)] @@ -77,7 +77,7 @@ pub use { pub mod prelude { #[doc(no_inline)] pub use futures_lite::{ - future::Future, + future::{Future, FutureExt}, io::{AsyncBufRead, AsyncBufReadExt}, io::{AsyncRead, AsyncReadExt}, io::{AsyncSeek, AsyncSeekExt},