diff options
author | Ferris Tseng <ferristseng@fastmail.fm> | 2017-11-26 16:35:16 -0500 |
---|---|---|
committer | Ferris Tseng <ferristseng@fastmail.fm> | 2017-11-26 16:35:16 -0500 |
commit | ad2a94ab6034bf26d187d6898defca6acb304cb1 (patch) | |
tree | 7d20e82a4ed8210fa9bc78df2e0a5970d7eac874 | |
parent | 1b8dfb4097998e7b76355a0ee07cbaf9f7ea7193 (diff) |
fix tests
-rw-r--r-- | ipfs-api/examples/add_tar.rs | 4 | ||||
-rw-r--r-- | ipfs-api/examples/ping_peer.rs | 4 | ||||
-rw-r--r-- | ipfs-api/examples/pubsub.rs | 2 | ||||
-rw-r--r-- | ipfs-api/src/request/ls.rs | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/ipfs-api/examples/add_tar.rs b/ipfs-api/examples/add_tar.rs index a6328af..fac6e4c 100644 --- a/ipfs-api/examples/add_tar.rs +++ b/ipfs-api/examples/add_tar.rs @@ -7,9 +7,11 @@ // extern crate ipfs_api; +extern crate futures; extern crate tar; extern crate tokio_core; +use futures::stream::Stream; use ipfs_api::IpfsClient; use std::io::Cursor; use tar::Builder; @@ -44,7 +46,7 @@ fn main() { println!("added tar file: {:?}", add); println!(""); - let req = client.tar_cat(&add.hash[..]); + let req = client.tar_cat(&add.hash[..]).concat2(); let cat = core.run(req).expect("expected a valid response"); println!("{}", String::from_utf8_lossy(&cat[..])); diff --git a/ipfs-api/examples/ping_peer.rs b/ipfs-api/examples/ping_peer.rs index 0e802a5..611bd21 100644 --- a/ipfs-api/examples/ping_peer.rs +++ b/ipfs-api/examples/ping_peer.rs @@ -37,7 +37,7 @@ fn main() { println!("discovered peer ({})", peer.peer); println!(""); println!("streaming 10 pings..."); - let req = client.ping(&peer.peer[..], Some(10)); + let req = client.ping(&peer.peer[..], &Some(10)); core.run(req.for_each(|ping| { println!("{:?}", ping); @@ -47,7 +47,7 @@ fn main() { println!(""); println!("gathering 15 pings..."); - let req = client.ping(&peer.peer[..], Some(15)); + let req = client.ping(&peer.peer[..], &Some(15)); let pings: Vec<_> = core.run(req.collect()).expect("expected a valid response"); for ping in pings.iter() { diff --git a/ipfs-api/examples/pubsub.rs b/ipfs-api/examples/pubsub.rs index a76e814..ed01b0b 100644 --- a/ipfs-api/examples/pubsub.rs +++ b/ipfs-api/examples/pubsub.rs @@ -60,7 +60,7 @@ fn main() { { let mut event_loop = Core::new().expect("expected event loop"); let client = get_client(&event_loop.handle()); - let req = client.pubsub_sub(TOPIC, None); + let req = client.pubsub_sub(TOPIC, &None); println!(""); println!("waiting for messages on ({})...", TOPIC); diff --git a/ipfs-api/src/request/ls.rs b/ipfs-api/src/request/ls.rs index 925d2eb..24136cf 100644 --- a/ipfs-api/src/request/ls.rs +++ b/ipfs-api/src/request/ls.rs @@ -27,6 +27,6 @@ impl<'a> ApiRequest for Ls<'a> { mod tests { use super::Ls; - serialize_url_test!(test_serializes_0, Ls { path: Some("test") }, "arg=test"); - serialize_url_test!(test_serializes_1, Ls { path: None }, ""); + serialize_url_test!(test_serializes_0, Ls { path: &Some("test") }, "arg=test"); + serialize_url_test!(test_serializes_1, Ls { path: &None }, ""); } |