mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
chore: refine feature flags (#1785)
Removes dependencies between Tokio feature flags. For example, `process` should not depend on `sync` simply because it uses the `mpsc` channel. Instead, feature flags represent **public** APIs that become available with the feature enabled. When the feature is not enabled, the functionality is removed. If another Tokio component requires the functionality, it is stays as `pub(crate)`. The threaded scheduler is now exposed under `rt-threaded`. This feature flag only enables the threaded scheduler and does not include I/O, networking, or time. Those features must be explictly enabled. A `full` feature flag is added that enables all features. `stdin`, `stdout`, `stderr` are exposed under `io-std`. Macros are used to scope code by feature flag.
This commit is contained in:
@@ -116,7 +116,7 @@ mod imp;
|
||||
|
||||
mod kill;
|
||||
|
||||
use crate::io::{AsyncRead, AsyncReadExt, AsyncWrite};
|
||||
use crate::io::{AsyncRead, AsyncWrite};
|
||||
use crate::process::kill::Kill;
|
||||
|
||||
use std::ffi::OsStr;
|
||||
@@ -771,7 +771,7 @@ impl Child {
|
||||
async fn read_to_end<A: AsyncRead + Unpin>(io: Option<A>) -> io::Result<Vec<u8>> {
|
||||
let mut vec = Vec::new();
|
||||
if let Some(mut io) = io {
|
||||
AsyncReadExt::read_to_end(&mut io, &mut vec).await?;
|
||||
crate::io::util::read_to_end(&mut io, &mut vec).await?;
|
||||
}
|
||||
Ok(vec)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user