mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-08 22:06:22 +00:00
Syntax updates.
This commit is contained in:
parent
d63f8340a5
commit
871013b942
@ -75,7 +75,7 @@ mod map_reduce {
|
||||
tag reduce_proto { emit_val(int); done; ref; release; }
|
||||
|
||||
fn start_mappers(ctrl: _chan[ctrl_proto], inputs: &[str]) -> [task_id] {
|
||||
let tasks = [];
|
||||
let tasks = ~[];
|
||||
for i: str in inputs {
|
||||
tasks += ~[task::_spawn(bind map_task(ctrl, i))];
|
||||
}
|
||||
@ -178,7 +178,8 @@ mod map_reduce {
|
||||
none. {
|
||||
// log_err "creating new reducer for " + k;
|
||||
let p = mk_port();
|
||||
tasks += [task::_spawn(bind reduce_task(k, p.mk_chan()))];
|
||||
tasks +=
|
||||
~[task::_spawn(bind reduce_task(k, p.mk_chan()))];
|
||||
c = p.recv();
|
||||
reducers.insert(k, c);
|
||||
}
|
||||
|
@ -185,17 +185,17 @@ fn append_lib_path(path: &str) { export_lib_path(util::make_new_path(path)); }
|
||||
fn export_lib_path(path: &str) { setenv(util::lib_path_env_var(), path); }
|
||||
|
||||
fn clone_ivecstr(v: &[str]) -> [[u8]] {
|
||||
let r = [];
|
||||
let r = ~[];
|
||||
for t: str in ivec::slice(v, 0u, ivec::len(v)) {
|
||||
r += [str::bytes(t)];
|
||||
r += ~[str::bytes(t)];
|
||||
}
|
||||
ret r;
|
||||
}
|
||||
|
||||
fn clone_ivecu8str(v: &[[u8]]) -> [str] {
|
||||
let r = [];
|
||||
let r = ~[];
|
||||
for t in ivec::slice(v, 0u, ivec::len(v)) {
|
||||
r += [str::unsafe_from_bytes(t)];
|
||||
r += ~[str::unsafe_from_bytes(t)];
|
||||
}
|
||||
ret r;
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ import std::comm::send;
|
||||
tag msg { closed; received([u8]); }
|
||||
|
||||
fn producer(c: _chan[[u8]]) {
|
||||
send(c, [1u8, 2u8, 3u8, 4u8]);
|
||||
let empty: [u8] = [];
|
||||
send(c, ~[1u8, 2u8, 3u8, 4u8]);
|
||||
let empty: [u8] = ~[];
|
||||
send(c, empty);
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ import std::comm::mk_port;
|
||||
import std::comm::send;
|
||||
|
||||
fn producer(c: _chan[[u8]]) {
|
||||
send(c, [1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8,
|
||||
8u8, 9u8, 10u8, 11u8, 12u8, 13u8 ]);
|
||||
send(c, ~[1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8,
|
||||
8u8, 9u8, 10u8, 11u8, 12u8, 13u8 ]);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user