about summary refs log tree commit diff
path: root/src/lib/vec.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-10-27 16:27:47 -0700
committerBrian Anderson <banderson@mozilla.com>2011-10-27 16:27:47 -0700
commit2b85817af8bc4bdfbb155f15367c3ebee09eb743 (patch)
treed26f857850b2ff7873f9b19bef660d81ebda6d7a /src/lib/vec.rs
parentcf2624106c36d2dd37ff357bc1eb48586719d015 (diff)
downloadrust-2b85817af8bc4bdfbb155f15367c3ebee09eb743.tar.gz
rust-2b85817af8bc4bdfbb155f15367c3ebee09eb743.zip
Convert various functions in std to take lambda blocks
Diffstat (limited to 'src/lib/vec.rs')
-rw-r--r--src/lib/vec.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/vec.rs b/src/lib/vec.rs
index c4d68590b4d..3763a13a37a 100644
--- a/src/lib/vec.rs
+++ b/src/lib/vec.rs
@@ -48,7 +48,7 @@ Type: init_op
 
 A function used to initialize the elements of a vector.
 */
-type init_op<T> = fn@(uint) -> T;
+type init_op<T> = block(uint) -> T;
 
 /*
 Function: init_fn
@@ -327,7 +327,7 @@ v - The vector to grow
 n - The number of elements to add
 init_fn - A function to call to retreive each appended element's value
 */
-fn grow_fn<T>(&v: [T], n: uint, init_fn: fn(uint) -> T) {
+fn grow_fn<T>(&v: [T], n: uint, init_fn: block(uint) -> T) {
     reserve(v, next_power_of_two(len(v) + n));
     let i: uint = 0u;
     while i < n { v += [init_fn(i)]; i += 1u; }
@@ -513,7 +513,7 @@ Function: position_pred
 
 Find the first index for which the value matches some predicate
 */
-fn position_pred<T>(f: fn(T) -> bool, v: [T]) -> option::t<uint> {
+fn position_pred<T>(f: block(T) -> bool, v: [T]) -> option::t<uint> {
     let i: uint = 0u;
     while i < len(v) { if f(v[i]) { ret some::<uint>(i); } i += 1u; }
     ret none;