diff options
| author | Olivier Saut <osaut@airpost.net> | 2013-05-17 23:11:18 +0200 |
|---|---|---|
| committer | Olivier Saut <osaut@airpost.net> | 2013-05-17 23:11:18 +0200 |
| commit | 7dc466f91f3f6bf44d72430bf760277cd4eebf3a (patch) | |
| tree | 2eb583d3a49e0cac33b43738629bde4d45ef4677 /src/libstd/future.rs | |
| parent | ff081980e7b5005d3e06ea539819ad98656d4a9b (diff) | |
| download | rust-7dc466f91f3f6bf44d72430bf760277cd4eebf3a.tar.gz rust-7dc466f91f3f6bf44d72430bf760277cd4eebf3a.zip | |
Correct the example given for a future, add punctuation where necessary
Diffstat (limited to 'src/libstd/future.rs')
| -rw-r--r-- | src/libstd/future.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libstd/future.rs b/src/libstd/future.rs index be33c0f4663..2ae61293a8f 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -15,9 +15,11 @@ * # Example * * ~~~ - * let delayed_fib = future::spawn {|| fib(5000) }; + * # fn fib(n: uint) -> uint {42}; + * # fn make_a_sandwich() {}; + * let mut delayed_fib = std::future::spawn (|| fib(5000) ); * make_a_sandwich(); - * io::println(fmt!("fib(5000) = %?", delayed_fib.get())) + * println(fmt!("fib(5000) = %?", delayed_fib.get())) * ~~~ */ @@ -51,7 +53,7 @@ priv enum FutureState<A> { /// Methods on the `future` type pub impl<A:Copy> Future<A> { fn get(&mut self) -> A { - //! Get the value of the future + //! Get the value of the future. *(self.get_ref()) } } @@ -87,7 +89,7 @@ pub impl<A> Future<A> { pub fn from_value<A>(val: A) -> Future<A> { /*! - * Create a future from a value + * Create a future from a value. * * The value is immediately available and calling `get` later will * not block. @@ -117,7 +119,7 @@ pub fn from_fn<A>(f: ~fn() -> A) -> Future<A> { /*! * Create a future from a function. * - * The first time that the value is requested it will be retreived by + * The first time that the value is requested it will be retrieved by * calling the function. Note that this function is a local * function. It is not spawned into another task. */ |
