Convert more core types to camel case

This commit is contained in:
Brian Anderson 2012-08-14 16:54:13 -07:00
parent 8be0f665bc
commit 74c69e1053
67 changed files with 457 additions and 427 deletions

View file

@ -1,7 +1,7 @@
//! A deque. Untested as of yet. Likely buggy
import option::{some, none};
import dvec::dvec;
import dvec::{DVec, dvec};
trait t<T> {
fn size() -> uint;
@ -40,14 +40,14 @@ fn create<T: copy>() -> t<T> {
return rv;
}
fn get<T: copy>(elts: dvec<cell<T>>, i: uint) -> T {
fn get<T: copy>(elts: DVec<cell<T>>, i: uint) -> T {
match elts.get_elt(i) { some(t) => t, _ => fail }
}
type repr<T> = {mut nelts: uint,
mut lo: uint,
mut hi: uint,
elts: dvec<cell<T>>};
elts: DVec<cell<T>>};
impl <T: copy> repr<T>: t<T> {
fn size() -> uint { return self.nelts; }

View file

@ -3,7 +3,7 @@
import map;
import map::{hashmap, str_hash};
import io::Reader;
import dvec::dvec;
import dvec::{DVec, dvec};
export url, userinfo, query;
export from_str, to_str;
@ -176,7 +176,7 @@ fn encode_plus(s: ~str) -> ~str {
/**
* Encode a hashmap to the 'application/x-www-form-urlencoded' media type.
*/
fn encode_form_urlencoded(m: hashmap<~str, @dvec<@~str>>) -> ~str {
fn encode_form_urlencoded(m: hashmap<~str, @DVec<@~str>>) -> ~str {
let mut out = ~"";
let mut first = true;
@ -203,7 +203,7 @@ fn encode_form_urlencoded(m: hashmap<~str, @dvec<@~str>>) -> ~str {
* type into a hashmap.
*/
fn decode_form_urlencoded(s: ~[u8]) ->
map::hashmap<~str, @dvec::dvec<@~str>> {
map::hashmap<~str, @dvec::DVec<@~str>> {
do io::with_bytes_reader(s) |rdr| {
let m = str_hash();
let mut key = ~"";

View file

@ -4,12 +4,12 @@
*/
import core::option;
import core::option::{some, none};
import dvec::dvec;
import dvec::{DVec, dvec};
import map::map;
// FIXME (#2347): Should not be @; there's a bug somewhere in rustc that
// requires this to be.
type smallintmap_<T: copy> = {v: dvec<option<T>>};
type smallintmap_<T: copy> = {v: DVec<option<T>>};
enum smallintmap<T:copy> {
smallintmap_(@smallintmap_<T>)

View file

@ -5,7 +5,7 @@
// simplest interface possible for representing and running tests
// while providing a base that other test frameworks may build off of.
import either::either;
import either::Either;
import result::{ok, err};
import io::WriterUtil;
import libc::size_t;
@ -53,8 +53,8 @@ type test_desc = {
fn test_main(args: ~[~str], tests: ~[test_desc]) {
let opts =
match parse_opts(args) {
either::left(o) => o,
either::right(m) => fail m
either::Left(o) => o,
either::Right(m) => fail m
};
if !run_tests_console(opts, tests) { fail ~"Some tests failed"; }
}
@ -62,7 +62,7 @@ fn test_main(args: ~[~str], tests: ~[test_desc]) {
type test_opts = {filter: option<~str>, run_ignored: bool,
logfile: option<~str>};
type opt_res = either<test_opts, ~str>;
type opt_res = Either<test_opts, ~str>;
// Parses command line arguments into test options
fn parse_opts(args: ~[~str]) -> opt_res {
@ -71,7 +71,7 @@ fn parse_opts(args: ~[~str]) -> opt_res {
let matches =
match getopts::getopts(args_, opts) {
ok(m) => m,
err(f) => return either::right(getopts::fail_str(f))
err(f) => return either::Right(getopts::fail_str(f))
};
let filter =
@ -85,7 +85,7 @@ fn parse_opts(args: ~[~str]) -> opt_res {
let test_opts = {filter: filter, run_ignored: run_ignored,
logfile: logfile};
return either::left(test_opts);
return either::Left(test_opts);
}
enum test_result { tr_ok, tr_failed, tr_ignored, }
@ -479,7 +479,7 @@ mod tests {
fn first_free_arg_should_be_a_filter() {
let args = ~[~"progname", ~"filter"];
let opts = match parse_opts(args) {
either::left(o) => o,
either::Left(o) => o,
_ => fail ~"Malformed arg in first_free_arg_should_be_a_filter"
};
assert ~"filter" == option::get(opts.filter);
@ -489,7 +489,7 @@ mod tests {
fn parse_ignored_flag() {
let args = ~[~"progname", ~"filter", ~"--ignored"];
let opts = match parse_opts(args) {
either::left(o) => o,
either::Left(o) => o,
_ => fail ~"Malformed arg in parse_ignored_flag"
};
assert (opts.run_ignored);

View file

@ -9,7 +9,7 @@ import iotask::{iotask, spawn_iotask};
import priv::{chan_from_global_ptr, weaken_task};
import comm::{port, chan, select2, listen};
import task::task_builder;
import either::{left, right};
import either::{Left, Right};
extern mod rustrt {
fn rust_uv_get_kernel_global_chan_ptr() -> *libc::uintptr_t;
@ -58,14 +58,14 @@ fn get_monitor_task_gl() -> iotask unsafe {
loop {
debug!{"in outer_loop..."};
match select2(weak_exit_po, msg_po) {
left(weak_exit) => {
Left(weak_exit) => {
// all normal tasks have ended, tell the
// libuv loop to tear_down, then exit
debug!{"weak_exit_po recv'd msg: %?", weak_exit};
iotask::exit(hl_loop);
break;
}
right(fetch_ch) => {
Right(fetch_ch) => {
debug!{"hl_loop req recv'd: %?", fetch_ch};
fetch_ch.send(hl_loop);
}