summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md12
-rw-r--r--ipfs-api/src/lib.rs18
2 files changed, 9 insertions, 21 deletions
diff --git a/README.md b/README.md
index 7899a71..4ce6302 100644
--- a/README.md
+++ b/README.md
@@ -63,11 +63,7 @@ let req = client
})
.map_err(|e| eprintln!("{}", e));
-actix_rt::System::new("test").block_on(lazy(|| {
- req.and_then(|_| {
- Ok(())
- })
-}));
+actix_rt::System::new("test").block_on(req);
```
#### Reading a file from IPFS
@@ -117,11 +113,7 @@ let req = client
})
.map_err(|e| eprintln!("{}", e));
-actix_rt::System::new("test").block_on(lazy(|| {
- req.and_then(|_| {
- Ok(())
- })
-}));
+actix_rt::System::new("test").block_on(req);
```
#### Additional Examples
diff --git a/ipfs-api/src/lib.rs b/ipfs-api/src/lib.rs
index 33fe085..40a1f3f 100644
--- a/ipfs-api/src/lib.rs
+++ b/ipfs-api/src/lib.rs
@@ -49,6 +49,7 @@
//! })
//! .map_err(|e| eprintln!("{}", e));
//!
+//! # #[cfg(feature = "hyper")]
//! hyper::rt::run(req);
//! # }
//! ```
@@ -75,11 +76,8 @@
//! })
//! .map_err(|e| eprintln!("{}", e));
//!
-//! actix_rt::System::new("test").block_on(lazy(|| {
-//! req.and_then(|_| {
-//! Ok(())
-//! })
-//! }));
+//! # #[cfg(feature = "actix")]
+//! actix_rt::System::new("test").block_on(req);
//! # }
//! ```
//!
@@ -110,6 +108,7 @@
//! })
//! .map_err(|e| eprintln!("{}", e));
//!
+//! # #[cfg(feature = "hyper")]
//! hyper::rt::run(req);
//! # }
//! ```
@@ -117,8 +116,8 @@
//! #### With Actix
//!
//! ```no_run
-//! # extern crate futures;
//! # extern crate actix_rt;
+//! # extern crate futures;
//! # extern crate ipfs_api;
//! #
//! use futures::{Future, lazy, Stream};
@@ -139,11 +138,8 @@
//! })
//! .map_err(|e| eprintln!("{}", e));
//!
-//! actix_rt::System::new("test").block_on(lazy(|| {
-//! req.and_then(|_| {
-//! Ok(())
-//! })
-//! }));
+//! # #[cfg(feature = "actix")]
+//! actix_rt::System::new("test").block_on(req);
//! # }
//! ```
//!