summaryrefslogtreecommitdiffstats
path: root/ipfs-api/examples/mfs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ipfs-api/examples/mfs.rs')
-rw-r--r--ipfs-api/examples/mfs.rs70
1 files changed, 34 insertions, 36 deletions
diff --git a/ipfs-api/examples/mfs.rs b/ipfs-api/examples/mfs.rs
index 97d1824..06a849e 100644
--- a/ipfs-api/examples/mfs.rs
+++ b/ipfs-api/examples/mfs.rs
@@ -49,42 +49,40 @@ fn main() {
let file_rm = client.files_rm("/test", true);
- let fut =
- mkdir
- .and_then(|_| {
- println!("making dirs /test/does/not/exist/yet...");
- println!();
-
- mkdir_recursive
- })
- .and_then(|_| {
- println!("getting status of /test/does...");
- println!();
-
- file_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(|stat| {
- print_stat(stat);
-
- println!("removing /test...");
- println!();
-
- file_rm
- })
- .map(|_| println!("done!"))
- .map_err(|e| eprintln!("{}", e))
- ;
-
- #[cfg(feature = "hyper")]
+ let fut = mkdir
+ .and_then(|_| {
+ println!("making dirs /test/does/not/exist/yet...");
+ println!();
+
+ mkdir_recursive
+ })
+ .and_then(|_| {
+ println!("getting status of /test/does...");
+ println!();
+
+ file_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(|stat| {
+ print_stat(stat);
+
+ println!("removing /test...");
+ println!();
+
+ file_rm
+ })
+ .map(|_| println!("done!"))
+ .map_err(|e| eprintln!("{}", e));
+
+ #[cfg(feature = "hyper")]
hyper::rt::run(fut);
#[cfg(feature = "actix")]
actix_web::actix::run(|| {