Skip to content

Commit 49cb3fc

Browse files
committed
Remove remaining references to option::t outside option itself
1 parent 4eb92d4 commit 49cb3fc

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/libcore/char.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pure fn to_digit(c: char) -> u8 unsafe {
103103
brief = "Convert a char to the corresponding digit. Returns none when \
104104
character is not a valid hexadecimal digit."
105105
)]
106-
pure fn maybe_digit(c: char) -> option::t<u8> {
106+
pure fn maybe_digit(c: char) -> option<u8> {
107107
alt c {
108108
'0' to '9' { option::some(c as u8 - ('0' as u8)) }
109109
'a' to 'z' { option::some(c as u8 + 10u8 - ('a' as u8)) }

src/libcore/extfmt.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mod ct {
6969

7070
// A formatted conversion from an expression to a string
7171
type conv =
72-
{param: option::t<int>,
72+
{param: option<int>,
7373
flags: [flag],
7474
width: count,
7575
precision: count,
@@ -115,7 +115,7 @@ mod ct {
115115
ret pieces;
116116
}
117117
fn peek_num(s: str, i: uint, lim: uint) ->
118-
option::t<{num: uint, next: uint}> {
118+
option<{num: uint, next: uint}> {
119119
if i >= lim { ret none; }
120120
let c = s[i];
121121
if !('0' as u8 <= c && c <= '9' as u8) { ret option::none; }
@@ -145,7 +145,7 @@ mod ct {
145145
next: ty.next};
146146
}
147147
fn parse_parameter(s: str, i: uint, lim: uint) ->
148-
{param: option::t<int>, next: uint} {
148+
{param: option<int>, next: uint} {
149149
if i >= lim { ret {param: none, next: i}; }
150150
let num = peek_num(s, i, lim);
151151
ret alt num {

src/libcore/task.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn spawn(+f: fn~()) -> task {
122122
}
123123

124124
fn spawn_inner(-f: fn~(),
125-
notify: option::t<comm::chan<task_notification>>) -> task unsafe {
125+
notify: option<comm::chan<task_notification>>) -> task unsafe {
126126
let closure: *rust_closure = unsafe::reinterpret_cast(ptr::addr_of(f));
127127
#debug("spawn: closure={%x,%x}", (*closure).fnptr, (*closure).envptr);
128128
let id = rustrt::new_task();

src/libcore/vec.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Returns:
230230
An option containing the last element of `v` if `v` is not empty, or
231231
none if `v` is empty.
232232
*/
233-
pure fn last<T: copy>(v: [const T]) -> option::t<T> {
233+
pure fn last<T: copy>(v: [const T]) -> option<T> {
234234
if len(v) == 0u { ret none; }
235235
ret some(v[len(v) - 1u]);
236236
}
@@ -445,7 +445,7 @@ Apply a function to each element of a vector and return the results
445445
If function `f` returns `none` then that element is excluded from
446446
the resulting vector.
447447
*/
448-
fn filter_map<T: copy, U: copy>(v: [const T], f: fn(T) -> option::t<U>)
448+
fn filter_map<T: copy, U: copy>(v: [const T], f: fn(T) -> option<U>)
449449
-> [U] {
450450
let result = [];
451451
for elem: T in v {
@@ -599,7 +599,7 @@ Apply function `f` to each element of `v`, starting from the first.
599599
When function `f` returns true then an option containing the element
600600
is returned. If `f` matches no elements then none is returned.
601601
*/
602-
fn find<T: copy>(v: [T], f: fn(T) -> bool) -> option::t<T> {
602+
fn find<T: copy>(v: [T], f: fn(T) -> bool) -> option<T> {
603603
for elt: T in v { if f(elt) { ret some(elt); } }
604604
ret none;
605605
}
@@ -614,7 +614,7 @@ Returns:
614614
option::some(uint) - The first index containing a matching value
615615
option::none - No elements matched
616616
*/
617-
fn position<T>(x: T, v: [T]) -> option::t<uint> {
617+
fn position<T>(x: T, v: [T]) -> option<uint> {
618618
let i: uint = 0u;
619619
while i < len(v) { if x == v[i] { ret some::<uint>(i); } i += 1u; }
620620
ret none;
@@ -625,7 +625,7 @@ Function: position_pred
625625
626626
Find the first index for which the value matches some predicate
627627
*/
628-
fn position_pred<T>(v: [T], f: fn(T) -> bool) -> option::t<uint> {
628+
fn position_pred<T>(v: [T], f: fn(T) -> bool) -> option<uint> {
629629
let i: uint = 0u;
630630
while i < len(v) { if f(v[i]) { ret some::<uint>(i); } i += 1u; }
631631
ret none;
@@ -1010,7 +1010,7 @@ mod tests {
10101010

10111011
pure fn is_equal(&&x: uint, &&y:uint) -> bool { ret x == y; }
10121012

1013-
fn square_if_odd(&&n: uint) -> option::t<uint> {
1013+
fn square_if_odd(&&n: uint) -> option<uint> {
10141014
ret if n % 2u == 1u { some(n * n) } else { none };
10151015
}
10161016

@@ -1267,7 +1267,7 @@ mod tests {
12671267
assert (w[1] == 9u);
12681268
assert (w[2] == 25u);
12691269

1270-
fn halve(&&i: int) -> option::t<int> {
1270+
fn halve(&&i: int) -> option<int> {
12711271
if i % 2 == 0 {
12721272
ret option::some::<int>(i / 2);
12731273
} else { ret option::none::<int>; }

0 commit comments

Comments
 (0)