From 49cb3fc7dfd2a8ee7f35aaa884da8f710cd4a94a Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Wed, 1 Feb 2012 16:49:36 -0800 Subject: Remove remaining references to option::t outside option itself --- src/libcore/vec.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libcore/vec.rs') diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 6275f715937..bb88ad3c561 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -230,7 +230,7 @@ Returns: An option containing the last element of `v` if `v` is not empty, or none if `v` is empty. */ -pure fn last(v: [const T]) -> option::t { +pure fn last(v: [const T]) -> option { if len(v) == 0u { ret none; } ret some(v[len(v) - 1u]); } @@ -445,7 +445,7 @@ Apply a function to each element of a vector and return the results If function `f` returns `none` then that element is excluded from the resulting vector. */ -fn filter_map(v: [const T], f: fn(T) -> option::t) +fn filter_map(v: [const T], f: fn(T) -> option) -> [U] { let result = []; for elem: T in v { @@ -599,7 +599,7 @@ Apply function `f` to each element of `v`, starting from the first. When function `f` returns true then an option containing the element is returned. If `f` matches no elements then none is returned. */ -fn find(v: [T], f: fn(T) -> bool) -> option::t { +fn find(v: [T], f: fn(T) -> bool) -> option { for elt: T in v { if f(elt) { ret some(elt); } } ret none; } @@ -614,7 +614,7 @@ Returns: option::some(uint) - The first index containing a matching value option::none - No elements matched */ -fn position(x: T, v: [T]) -> option::t { +fn position(x: T, v: [T]) -> option { let i: uint = 0u; while i < len(v) { if x == v[i] { ret some::(i); } i += 1u; } ret none; @@ -625,7 +625,7 @@ Function: position_pred Find the first index for which the value matches some predicate */ -fn position_pred(v: [T], f: fn(T) -> bool) -> option::t { +fn position_pred(v: [T], f: fn(T) -> bool) -> option { let i: uint = 0u; while i < len(v) { if f(v[i]) { ret some::(i); } i += 1u; } ret none; @@ -1010,7 +1010,7 @@ mod tests { pure fn is_equal(&&x: uint, &&y:uint) -> bool { ret x == y; } - fn square_if_odd(&&n: uint) -> option::t { + fn square_if_odd(&&n: uint) -> option { ret if n % 2u == 1u { some(n * n) } else { none }; } @@ -1267,7 +1267,7 @@ mod tests { assert (w[1] == 9u); assert (w[2] == 25u); - fn halve(&&i: int) -> option::t { + fn halve(&&i: int) -> option { if i % 2 == 0 { ret option::some::(i / 2); } else { ret option::none::; } -- cgit 1.4.1-3-g733a5