diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-10-18 15:07:40 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-10-20 18:23:48 -0700 |
| commit | 29ad3bdb103bec8d45df6f015802668722af6a00 (patch) | |
| tree | 81154dcf545b6848eb54cc780aa44273cb61aefb /src/test/stdtest | |
| parent | f324704c0a010a2ba89bec67d89eb6eccfa4e412 (diff) | |
| download | rust-29ad3bdb103bec8d45df6f015802668722af6a00.tar.gz rust-29ad3bdb103bec8d45df6f015802668722af6a00.zip | |
Make fn denote a bare function. Convert fn to fn@ as needed
Diffstat (limited to 'src/test/stdtest')
| -rw-r--r-- | src/test/stdtest/deque.rs | 4 | ||||
| -rw-r--r-- | src/test/stdtest/map.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/test/stdtest/deque.rs b/src/test/stdtest/deque.rs index 1f4f2d7790e..d532d975535 100644 --- a/src/test/stdtest/deque.rs +++ b/src/test/stdtest/deque.rs @@ -79,7 +79,7 @@ fn test_boxes(a: @int, b: @int, c: @int, d: @int) { assert (deq.get(3) == d); } -type eqfn<T> = fn(T, T) -> bool; +type eqfn<T> = fn@(T, T) -> bool; fn test_parameterized<@T>(e: eqfn<T>, a: T, b: T, c: T, d: T) { let deq: deque::t<T> = deque::create::<T>(); @@ -178,7 +178,7 @@ fn test() { two(17, 42)); log "*** test parameterized: taggypar<int>"; - let eq4: eqfn<taggypar<int>> = taggypareq::<int>; + let eq4: eqfn<taggypar<int>> = bind taggypareq::<int>(_, _); test_parameterized::<taggypar<int>>(eq4, onepar::<int>(1), twopar::<int>(1, 2), threepar::<int>(1, 2, 3), diff --git a/src/test/stdtest/map.rs b/src/test/stdtest/map.rs index 18f64bf6899..45d1a535e02 100644 --- a/src/test/stdtest/map.rs +++ b/src/test/stdtest/map.rs @@ -12,7 +12,7 @@ import std::option; fn test_simple() { log "*** starting test_simple"; fn eq_uint(&&x: uint, &&y: uint) -> bool { ret x == y; } - let hasher_uint: map::hashfn<uint> = util::id; + let hasher_uint: map::hashfn<uint> = bind util::id(_); let eqer_uint: map::eqfn<uint> = eq_uint; let hasher_str: map::hashfn<str> = str::hash; let eqer_str: map::eqfn<str> = str::eq; @@ -85,7 +85,7 @@ fn test_growth() { let num_to_insert: uint = 64u; fn eq_uint(&&x: uint, &&y: uint) -> bool { ret x == y; } log "uint -> uint"; - let hasher_uint: map::hashfn<uint> = util::id; + let hasher_uint: map::hashfn<uint> = bind util::id(_); let eqer_uint: map::eqfn<uint> = eq_uint; let hm_uu: map::hashmap<uint, uint> = map::mk_hashmap::<uint, uint>(hasher_uint, eqer_uint); |
