chore: Remove dependency on futures-codec
We were only using it for splitting lines, which is already possible without it.
This commit is contained in:
parent
b5514a6e24
commit
77503b1545
4 changed files with 17 additions and 21 deletions
|
|
@ -1,6 +1,5 @@
|
|||
use blocking::Unblock;
|
||||
use futures_codec::{FramedRead, LinesCodec};
|
||||
use futures_lite::{AsyncRead, Stream, StreamExt};
|
||||
use futures_lite::{AsyncBufReadExt, AsyncRead, Stream, StreamExt};
|
||||
use serde::Deserialize;
|
||||
use std::io;
|
||||
|
||||
|
|
@ -20,7 +19,8 @@ where
|
|||
I: AsyncRead + Unpin + Send,
|
||||
S: for<'a> Deserialize<'a>,
|
||||
{
|
||||
FramedRead::new(input, LinesCodec)
|
||||
futures_lite::io::BufReader::new(input)
|
||||
.lines()
|
||||
.take_while(Result::is_ok)
|
||||
.map(Result::unwrap)
|
||||
.map(|line| serde_json::from_str::<S>(&line))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue