Skip to content

Commit

Permalink
Camel case the option type
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Aug 26, 2012
1 parent d9a6a63 commit 8337fa1
Show file tree
Hide file tree
Showing 330 changed files with 4,939 additions and 4,936 deletions.
14 changes: 7 additions & 7 deletions doc/rust.md
Expand Up @@ -842,14 +842,14 @@ An example of imports:
import foo = core::info;
import core::float::sin;
import core::str::{slice, to_upper};
import core::option::some;
import core::option::Some;
fn main() {
// Equivalent to 'log(core::info, core::float::sin(1.0));'
log(foo, sin(1.0));
// Equivalent to 'log(core::info, core::option::some(1.0));'
log(info, some(1.0));
// Equivalent to 'log(core::info, core::option::Some(1.0));'
log(info, Some(1.0));
// Equivalent to 'log(core::info,
// core::str::to_upper(core::str::slice(~"foo", 0u, 1u)));'
Expand Down Expand Up @@ -2229,14 +2229,14 @@ consist of a bool-typed expression following the `if` keyword. A pattern
guard may refer to the variables bound within the pattern they follow.

~~~~
# let maybe_digit = some(0);
# let maybe_digit = Some(0);
# fn process_digit(i: int) { }
# fn process_other(i: int) { }
let message = match maybe_digit {
some(x) if x < 10 => process_digit(x),
some(x) => process_other(x),
none => fail
Some(x) if x < 10 => process_digit(x),
Some(x) => process_other(x),
None => fail
};
~~~~

Expand Down
6 changes: 3 additions & 3 deletions doc/tutorial.md
Expand Up @@ -1964,7 +1964,7 @@ Rust's type inferrer works very well with generics, but there are
programs that just can't be typed.

~~~~
let n = option::none;
let n = option::None;
# option::iter(n, fn&(&&x:int) {})
~~~~

Expand All @@ -1974,9 +1974,9 @@ you really want to have such a statement, you'll have to write it like
this:

~~~~
let n2: option<int> = option::none;
let n2: Option<int> = option::None;
// or
let n = option::none::<int>;
let n = option::None::<int>;
~~~~

Note that, in a value expression, `<` already has a meaning as a
Expand Down

0 comments on commit 8337fa1

Please sign in to comment.