Futures hello world.

This commit is contained in:
Tangent 128 2017-01-09 22:40:21 -05:00
parent 0d9cb1dcfa
commit 5de9bf9aee
3 changed files with 27 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
target
Cargo.lock

7
Cargo.toml Normal file
View File

@ -0,0 +1,7 @@
[package]
name = "lab_ebml"
version = "0.1.0"
authors = ["Tangent 128 <Tangent128@gmail.com>"]
[dependencies]
futures = "^0.1.7"

18
src/lib.rs Normal file
View File

@ -0,0 +1,18 @@
extern crate futures;
#[cfg(test)]
mod tests {
use futures::future::{ok, Future};
#[test]
fn hello_futures() {
let my_future = ok::<String, ()>("Hello".into())
.map(|hello| hello + ", Futures!");
let string_result = my_future.wait().unwrap();
assert_eq!(string_result, "Hello, Futures!");
}
}