Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

chore: Consolidate on using tokio-util for stream compatibility #59

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 117 additions & 31 deletions parsers/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions parsers/rust/subtext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "Apache-2.0"
edition = "2021"

[features]
stream = ["tokio", "async-stream", "futures", "async-compat", "async-utf8-decoder"]
stream = ["tokio", "tokio-util", "async-stream", "futures", "async-utf8-decoder"]

[dependencies]
tendril = "~0.4"
Expand All @@ -15,9 +15,9 @@ log = "~0.4"

# For stream parsing only....
tokio = { version = "^1", features = ["io-util", "macros", "test-util"], optional = true }
tokio-util = { version = "0.7", features = ["compat"], optional = true }
async-stream = { version = "~0.3", optional = true }
futures = { version = "~0.3", optional = true }
async-compat = { version = "~0.2", optional = true }
async-utf8-decoder = { version = "~0.3", optional = true }

[dev-dependencies]
Expand Down
8 changes: 4 additions & 4 deletions parsers/rust/subtext/src/stream.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use anyhow::{anyhow, Result};
use async_compat::CompatExt;
use async_stream::try_stream;
use async_utf8_decoder::Utf8Decoder;
use futures::{Stream, StreamExt};
use tokio::io::AsyncRead;
use tokio_util::compat::TokioAsyncReadCompatExt;

use crate::{block::Block, parse, primitive::Entity};

Expand Down Expand Up @@ -56,9 +56,9 @@ where

#[cfg(test)]
mod tests {
use async_compat::CompatExt;
use futures::{channel::mpsc, io, SinkExt};
use futures::{pin_mut, StreamExt, TryStream, TryStreamExt};
use futures::{channel::mpsc, SinkExt};
use futures::{pin_mut, StreamExt, TryStreamExt};
use tokio_util::compat::{FuturesAsyncReadCompatExt};

use crate::block::Block;
use crate::primitive::Entity;
Expand Down