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

Commit

Permalink
Merge pull request #59 from subconsciousnetwork/async-compat-to-tokio…
Browse files Browse the repository at this point in the history
…-util

chore: Consolidate on using tokio-util for stream compatibility
  • Loading branch information
cdata authored Dec 4, 2023
2 parents 9d61c04 + afe4836 commit f31a64f
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 37 deletions.
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

0 comments on commit f31a64f

Please sign in to comment.