Remove Deprecated Tokio APIs

Summary: Removed deprecated Tokio API calls in mercurial-bundles/ folder

Reviewed By: sid0

Differential Revision: D5960557

fbshipit-source-id: 3ea4c781d9845ac02893d36c8f0079ec9a9d87bb
This commit is contained in:
Trevor Aron 2017-10-06 11:06:39 -07:00 committed by Facebook Github Bot
parent 8d043552f4
commit 13f8ef0817
4 changed files with 6 additions and 6 deletions

View File

@ -106,7 +106,7 @@ mod test {
// Encode this sequence.
let cursor = Cursor::new(Vec::with_capacity(32 * 1024));
let partial_write = PartialAsyncWrite::new(cursor, write_ops);
let packer = packer::Cg2Packer::new(seq.to_stream());
let packer = packer::Cg2Packer::new(seq.to_stream().and_then(|x| x));
let sink = FramedWrite::new(partial_write, ChunkEncoder);
let encode_fut = packer.forward(sink);

View File

@ -222,7 +222,7 @@ mod test {
let cursor = Cursor::new(Vec::with_capacity(32 * 1024));
let sink = FramedWrite::new(cursor, ChunkEncoder);
let encode_fut = sink.send_all(stream::iter(chunks_res));
let encode_fut = sink.send_all(stream::iter_ok(chunks_res).and_then(|x| x));
let mut core = Core::new().unwrap();

View File

@ -5,8 +5,6 @@
// GNU General Public License version 2 or any later version.
#![deny(warnings)]
// TODO: (sid0) T21726029 tokio/futures deprecated a bunch of stuff, clean it all up
#![allow(deprecated)]
extern crate ascii;
#[macro_use]

View File

@ -82,9 +82,11 @@ impl Cg2PartSequence {
///
/// This returns a clone of everything because streams can't really return
/// references at the moment.
pub fn to_stream(&self) -> stream::Iter<IntoIter<result::Result<changegroup::Part, Error>>> {
pub fn to_stream(
&self,
) -> stream::IterOk<IntoIter<result::Result<changegroup::Part, Error>>, Error> {
let part_results: Vec<_> = self.as_iter().cloned().map(|x| Ok(x)).collect();
stream::iter(part_results.into_iter())
stream::iter_ok(part_results.into_iter())
}
}