From 2f5d0ebc1a5bf38c1ad4979a5f861b479d376182 Mon Sep 17 00:00:00 2001 From: Ferris Tseng Date: Mon, 22 Feb 2021 23:23:25 -0500 Subject: add + Unpin to fix broken tests --- ipfs-api-prelude/src/api.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ipfs-api-prelude') diff --git a/ipfs-api-prelude/src/api.rs b/ipfs-api-prelude/src/api.rs index a039941..611092a 100644 --- a/ipfs-api-prelude/src/api.rs +++ b/ipfs-api-prelude/src/api.rs @@ -34,7 +34,7 @@ macro_rules! impl_stream_api_response { }; (($self:ident, $req:expr, $form:expr) |$var:ident| => $impl:block) => { match $self.build_base_request(&$req, $form) { - Ok($var) => Box::new($impl), + Ok($var) => $impl, Err(e) => Box::new(future::err(e).into_stream()), } }; @@ -397,7 +397,7 @@ pub trait IpfsApi: Backend { /// .try_concat(); /// ``` /// - fn cat(&self, path: &str) -> Box>> { + fn cat(&self, path: &str) -> Box> + Unpin> { impl_stream_api_response! { (self, request::Cat { path }, None) => request_stream_bytes } @@ -627,7 +627,7 @@ pub trait IpfsApi: Backend { /// .try_concat(); /// ``` /// - fn dag_get(&self, path: &str) -> Box>> { + fn dag_get(&self, path: &str) -> Box> + Unpin> { impl_stream_api_response! { (self, request::DagGet { path }, None) => request_stream_bytes } @@ -711,7 +711,7 @@ pub trait IpfsApi: Backend { fn dht_get( &self, key: &str, - ) -> Box>> { + ) -> Box> + Unpin> { impl_stream_api_response! { (self, request::DhtGet { key }, None) => request_stream_json } @@ -731,7 +731,7 @@ pub trait IpfsApi: Backend { fn dht_provide( &self, key: &str, - ) -> Box>> { + ) -> Box> + Unpin> { impl_stream_api_response! { (self, request::DhtProvide { key }, None) => request_stream_json } @@ -751,7 +751,7 @@ pub trait IpfsApi: Backend { &self, key: &str, value: &str, - ) -> Box>> { + ) -> Box> + Unpin> { impl_stream_api_response! { (self, request::DhtPut { key, value }, None) => request_stream_json } @@ -771,7 +771,7 @@ pub trait IpfsApi: Backend { fn dht_query( &self, peer: &str, - ) -> Box>> { + ) -> Box> + Unpin> { impl_stream_api_response! { (self, request::DhtQuery { peer }, None) => request_stream_json } -- cgit v1.2.3