diff options
author | Sameer Puri <11097096+sameer@users.noreply.github.com> | 2018-12-31 16:29:00 -0500 |
---|---|---|
committer | Sameer Puri <11097096+sameer@users.noreply.github.com> | 2018-12-31 16:29:00 -0500 |
commit | 2704d2b28996808fe4d20138034e1af81ddc8b0e (patch) | |
tree | b1107cfa3cedfa75805dd91bb7029ee2e50e5c9c /ipfs-api/examples | |
parent | e7542e68ce88665290ce4a6af6334f34e1479c5c (diff) |
Run cargo fmt
Diffstat (limited to 'ipfs-api/examples')
-rw-r--r-- | ipfs-api/examples/add_tar.rs | 6 | ||||
-rw-r--r-- | ipfs-api/examples/bootstrap_default.rs | 6 | ||||
-rw-r--r-- | ipfs-api/examples/dns.rs | 6 | ||||
-rw-r--r-- | ipfs-api/examples/mfs.rs | 12 | ||||
-rw-r--r-- | ipfs-api/examples/ping_peer.rs | 6 | ||||
-rw-r--r-- | ipfs-api/examples/pubsub.rs | 3 |
6 files changed, 26 insertions, 13 deletions
diff --git a/ipfs-api/examples/add_tar.rs b/ipfs-api/examples/add_tar.rs index 1dc3b61..1880712 100644 --- a/ipfs-api/examples/add_tar.rs +++ b/ipfs-api/examples/add_tar.rs @@ -45,10 +45,12 @@ fn main() { println!(); client.tar_cat(&add.hash[..]).concat2() - }).map(|cat| { + }) + .map(|cat| { println!("{}", String::from_utf8_lossy(&cat[..])); println!(); - }).map_err(|e| eprintln!("{}", e)); + }) + .map_err(|e| eprintln!("{}", e)); hyper::rt::run(req) } diff --git a/ipfs-api/examples/bootstrap_default.rs b/ipfs-api/examples/bootstrap_default.rs index 1d6d75c..6ba9575 100644 --- a/ipfs-api/examples/bootstrap_default.rs +++ b/ipfs-api/examples/bootstrap_default.rs @@ -49,11 +49,13 @@ fn main() { println!("dropping all bootstrap peers..."); drop - }).and_then(|_| { + }) + .and_then(|_| { println!(); println!("adding default peers..."); add - }).map_err(|e| eprintln!("{}", e)), + }) + .map_err(|e| eprintln!("{}", e)), ); } diff --git a/ipfs-api/examples/dns.rs b/ipfs-api/examples/dns.rs index 2bbb92a..78b4086 100644 --- a/ipfs-api/examples/dns.rs +++ b/ipfs-api/examples/dns.rs @@ -27,14 +27,16 @@ fn main() { println!(); client.file_ls(&dns.path[..]) - }).map(|contents| { + }) + .map(|contents| { println!("found contents:"); for directory in contents.objects.values() { for file in directory.links.iter() { println!("[{}] ({} bytes)", file.name, file.size); } } - }).map_err(|e| eprintln!("{}", e)); + }) + .map_err(|e| eprintln!("{}", e)); hyper::rt::run(req); } diff --git a/ipfs-api/examples/mfs.rs b/ipfs-api/examples/mfs.rs index 2a99bea..8bea192 100644 --- a/ipfs-api/examples/mfs.rs +++ b/ipfs-api/examples/mfs.rs @@ -53,19 +53,22 @@ fn main() { println!(); mkdir_recursive - }).and_then(|_| { + }) + .and_then(|_| { println!("getting status of /test/does..."); println!(); file_stat - }).and_then(|stat| { + }) + .and_then(|stat| { print_stat(stat); println!("writing source file to /test/mfs.rs"); println!(); file_write - }).and_then(|_| file_write_stat) + }) + .and_then(|_| file_write_stat) .and_then(|stat| { print_stat(stat); @@ -73,7 +76,8 @@ fn main() { println!(); file_rm - }).map(|_| println!("done!")) + }) + .map(|_| println!("done!")) .map_err(|e| eprintln!("{}", e)), ) } diff --git a/ipfs-api/examples/ping_peer.rs b/ipfs-api/examples/ping_peer.rs index 9cd7835..1d32210 100644 --- a/ipfs-api/examples/ping_peer.rs +++ b/ipfs-api/examples/ping_peer.rs @@ -51,11 +51,13 @@ fn main() { ping_gather }) - }).map(|pings: Vec<PingResponse>| { + }) + .map(|pings: Vec<PingResponse>| { for ping in pings.iter() { println!("got response ({:?}) at ({})...", ping.text, ping.time); } - }).map_err(|e| eprintln!("{}", e)); + }) + .map_err(|e| eprintln!("{}", e)); hyper::rt::run(req); } diff --git a/ipfs-api/examples/pubsub.rs b/ipfs-api/examples/pubsub.rs index f773841..10ee0c5 100644 --- a/ipfs-api/examples/pubsub.rs +++ b/ipfs-api/examples/pubsub.rs @@ -68,7 +68,8 @@ fn main() { println!("received ({:?})", msg); Ok(()) - }).map_err(|e| eprintln!("{}", e)), + }) + .map_err(|e| eprintln!("{}", e)), ) } } |