Skip to content

Commit 9e02ebe

Browse files
committed
Fix build error for i686-unknown-linux-gnu target in Tokio tests
1 parent 234f9f3 commit 9e02ebe

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tokio-util/src/io/sync_bridge.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ use tokio::io::{
119119
///
120120
/// ## Example 2: Compressing Data
121121
///
122-
/// When compressing data, avoid using `SyncIoBridge` with non-async compression
123-
/// libraries, as it may lead to inefficient and blocking code. Instead, use an
124-
/// async compression library such as the [`async-compression`](https://docs.rs/async-compression/latest/async_compression/)
125-
/// crate, which is designed to work with asynchronous data streams.
122+
/// When compressing data, the use of `SyncIoBridge` is unnecessary as it introduces
123+
/// blocking and inefficient code. Instead, you can utilize an async compression library
124+
/// such as the [`async-compression`](https://docs.rs/async-compression/latest/async_compression/)
125+
/// crate, which is built to handle asynchronous data streams efficiently.
126126
///
127127
/// ```ignore
128128
/// use async_compression::tokio::write::GzipEncoder;
@@ -159,9 +159,10 @@ use tokio::io::{
159159
///
160160
/// ## Example 3: Parsing `JSON`
161161
///
162-
/// When parsing serialization formats such as `JSON`, avoid using `SyncIoBridge`
163-
/// with functions that `deserialize` data from a type implementing `std::io::Read`,
164-
/// such as `serde_json::from_reader`.
162+
///
163+
/// `SyncIoBridge` is not ideal when parsing data formats such as `JSON`, as it
164+
/// blocks async operations. A more efficient approach is to read data asynchronously
165+
/// into memory and then `deserialize` it, avoding unnecessary synchronization overhead.
165166
///
166167
/// ```rust,no_run
167168
/// use tokio::io::AsyncRead;

0 commit comments

Comments
 (0)