diff options
author | Ferris Tseng <ferristseng@gmail.com> | 2019-02-13 20:38:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-13 20:38:01 -0500 |
commit | de3588c7c369ea4f4cca66f89c12511d1170e5f5 (patch) | |
tree | 965a5a80b387c0eb719ca568a96a729d9d3f2ade /ipfs-api/examples/add_tar.rs | |
parent | f125fdbde329095419630e02ebf33d2c73aeced7 (diff) | |
parent | 4bdebbf4d1d1edb839eba860b013e3fdb870f66e (diff) |
Merge pull request #28 from ferristseng/actix
Add actix feature for using actix-web
Diffstat (limited to 'ipfs-api/examples/add_tar.rs')
-rw-r--r-- | ipfs-api/examples/add_tar.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ipfs-api/examples/add_tar.rs b/ipfs-api/examples/add_tar.rs index 1880712..5d75e28 100644 --- a/ipfs-api/examples/add_tar.rs +++ b/ipfs-api/examples/add_tar.rs @@ -6,7 +6,10 @@ // copied, modified, or distributed except according to those terms. // +#[cfg(feature = "actix")] +extern crate actix_web; extern crate futures; +#[cfg(feature = "hyper")] extern crate hyper; extern crate ipfs_api; extern crate tar; @@ -52,5 +55,13 @@ fn main() { }) .map_err(|e| eprintln!("{}", e)); - hyper::rt::run(req) + #[cfg(feature = "hyper")] + hyper::rt::run(req); + #[cfg(feature = "actix")] + actix_web::actix::run(|| { + req.then(|_| { + actix_web::actix::System::current().stop(); + Ok(()) + }) + }); } |