Permalink
Browse files

Camel case the option type

  • Loading branch information...
1 parent d9a6a63 commit 8337fa1a545e7958389c6025661990eedd9c1b91 @brson brson committed Aug 20, 2012
Showing 330 changed files with 4,939 additions and 4,936 deletions.
View
@@ -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)));'
@@ -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
};
~~~~
View
@@ -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) {})
~~~~
@@ -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
Oops, something went wrong.

0 comments on commit 8337fa1

Please sign in to comment.