Skip to content

Commit 7dc466f

Browse files
author
Olivier Saut
committed
Correct the example given for a future, add punctuation where necessary
1 parent ff08198 commit 7dc466f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/libstd/future.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -15,9 +15,11 @@
1515
* # Example
1616
*
1717
* ~~~
18-
* let delayed_fib = future::spawn {|| fib(5000) };
18+
* # fn fib(n: uint) -> uint {42};
19+
* # fn make_a_sandwich() {};
20+
* let mut delayed_fib = std::future::spawn (|| fib(5000) );
1921
* make_a_sandwich();
20-
* io::println(fmt!("fib(5000) = %?", delayed_fib.get()))
22+
* println(fmt!("fib(5000) = %?", delayed_fib.get()))
2123
* ~~~
2224
*/
2325

@@ -51,7 +53,7 @@ priv enum FutureState<A> {
5153
/// Methods on the `future` type
5254
pub impl<A:Copy> Future<A> {
5355
fn get(&mut self) -> A {
54-
//! Get the value of the future
56+
//! Get the value of the future.
5557
*(self.get_ref())
5658
}
5759
}
@@ -87,7 +89,7 @@ pub impl<A> Future<A> {
8789

8890
pub fn from_value<A>(val: A) -> Future<A> {
8991
/*!
90-
* Create a future from a value
92+
* Create a future from a value.
9193
*
9294
* The value is immediately available and calling `get` later will
9395
* not block.
@@ -117,7 +119,7 @@ pub fn from_fn<A>(f: ~fn() -> A) -> Future<A> {
117119
/*!
118120
* Create a future from a function.
119121
*
120-
* The first time that the value is requested it will be retreived by
122+
* The first time that the value is requested it will be retrieved by
121123
* calling the function. Note that this function is a local
122124
* function. It is not spawned into another task.
123125
*/

0 commit comments

Comments
 (0)