From cb7a5395ddfaa7b8fc40db57b32c22f69780ccd6 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 10 Sep 2012 15:38:28 -0700 Subject: Convert std::map to camel case --- src/test/auxiliary/issue-2631-a.rs | 4 ++-- src/test/bench/core-map.rs | 8 ++++---- src/test/bench/core-std.rs | 4 ++-- src/test/bench/graph500-bfs.rs | 8 ++++---- src/test/bench/shootout-chameneos-redux.rs | 2 +- src/test/bench/shootout-k-nucleotide-pipes.rs | 10 +++++----- src/test/bench/shootout-k-nucleotide.rs | 10 +++++----- src/test/bench/shootout-mandelbrot.rs | 2 +- src/test/bench/task-perf-word-count-generic.rs | 6 +++--- src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs | 6 +++--- src/test/compile-fail/for-loop-decl.rs | 4 ++-- src/test/compile-fail/map-types.rs | 10 +++++----- src/test/run-fail/unwind-misc-1.rs | 4 ++-- src/test/run-pass/class-impl-very-parameterized-trait.rs | 2 +- src/test/run-pass/extern-mod-syntax.rs | 2 +- src/test/run-pass/hashmap-memory.rs | 6 +++--- src/test/run-pass/issue-1696.rs | 2 +- src/test/run-pass/issue-2804-2.rs | 4 ++-- src/test/run-pass/issue-2804.rs | 6 +++--- 19 files changed, 50 insertions(+), 50 deletions(-) (limited to 'src/test') diff --git a/src/test/auxiliary/issue-2631-a.rs b/src/test/auxiliary/issue-2631-a.rs index 4c3a6ea6121..f98f5a3cafc 100644 --- a/src/test/auxiliary/issue-2631-a.rs +++ b/src/test/auxiliary/issue-2631-a.rs @@ -5,9 +5,9 @@ use std; use dvec::*; use dvec::DVec; -use std::map::hashmap; +use std::map::HashMap; -type header_map = hashmap<~str, @DVec<@~str>>; +type header_map = HashMap<~str, @DVec<@~str>>; // the unused ty param is necessary so this gets monomorphized fn request(req: header_map) { diff --git a/src/test/bench/core-map.rs b/src/test/bench/core-map.rs index 112c25d5146..6f3dce6647a 100644 --- a/src/test/bench/core-map.rs +++ b/src/test/bench/core-map.rs @@ -28,7 +28,7 @@ fn timed(result: &mut float, *result = (end - start); } -fn int_benchmarks>(make_map: fn() -> M, +fn int_benchmarks>(make_map: fn() -> M, rng: @rand::Rng, num_keys: uint, results: &mut Results) { @@ -69,7 +69,7 @@ fn int_benchmarks>(make_map: fn() -> M, } } -fn str_benchmarks>(make_map: fn() -> M, +fn str_benchmarks>(make_map: fn() -> M, rng: @rand::Rng, num_keys: uint, results: &mut Results) { @@ -156,9 +156,9 @@ fn main(args: ~[~str]) { { let rng = rand::seeded_rng(copy seed); let mut results = empty_results(); - int_benchmarks::>( + int_benchmarks::>( map::uint_hash, rng, num_keys, &mut results); - str_benchmarks::>( + str_benchmarks::>( map::str_hash, rng, num_keys, &mut results); write_results("libstd::map::hashmap", &results); } diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 5f846151917..e8c77926fd3 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -4,7 +4,7 @@ use std; use std::time::precise_time_s; use std::map; -use std::map::{map, hashmap}; +use std::map::{Map, HashMap}; use io::{Reader, ReaderUtil}; @@ -66,7 +66,7 @@ fn read_line() { fn str_set() { let r = rand::Rng(); - let s = map::hashmap(); + let s = map::HashMap(); for int::range(0, 1000) |_i| { map::set_add(s, r.gen_str(10)); diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index fda121c6596..d37f3aad5c2 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -8,8 +8,8 @@ use std; use std::arc; use std::time; use std::map; -use std::map::map; -use std::map::hashmap; +use std::map::Map; +use std::map::HashMap; use std::deque; use std::deque::Deque; use std::par; @@ -69,7 +69,7 @@ fn make_edges(scale: uint, edgefactor: uint) -> ~[(node_id, node_id)] { fn make_graph(N: uint, edges: ~[(node_id, node_id)]) -> graph { let graph = do vec::from_fn(N) |_i| { - map::hashmap::() + map::HashMap::() }; do vec::each(edges) |e| { @@ -85,7 +85,7 @@ fn make_graph(N: uint, edges: ~[(node_id, node_id)]) -> graph { } fn gen_search_keys(graph: graph, n: uint) -> ~[node_id] { - let keys = map::hashmap::(); + let keys = map::HashMap::(); let r = rand::Rng(); while keys.size() < n { diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 91f77a77ffb..0541e862aa7 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -2,7 +2,7 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; use std::sort; fn print_complements() { diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 69e84286f23..c7ada4ef38d 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -4,14 +4,14 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; use std::sort; use io::ReaderUtil; use pipes::{stream, Port, Chan}; use cmp::Ord; // given a map, print a sorted version of it -fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { +fn sort_and_fmt(mm: HashMap<~[u8], uint>, total: uint) -> ~str { fn pct(xx: uint, yy: uint) -> float { return (xx as float) * 100f / (yy as float); } @@ -57,7 +57,7 @@ fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { } // given a map, search for the frequency of a pattern -fn find(mm: hashmap<~[u8], uint>, key: ~str) -> uint { +fn find(mm: HashMap<~[u8], uint>, key: ~str) -> uint { match mm.find(str::to_bytes(str::to_lower(key))) { option::None => { return 0u; } option::Some(num) => { return num; } @@ -65,7 +65,7 @@ fn find(mm: hashmap<~[u8], uint>, key: ~str) -> uint { } // given a map, increment the counter for a key -fn update_freq(mm: hashmap<~[u8], uint>, key: &[u8]) { +fn update_freq(mm: HashMap<~[u8], uint>, key: &[u8]) { let key = vec::slice(key, 0, key.len()); match mm.find(key) { option::None => { mm.insert(key, 1u ); } @@ -92,7 +92,7 @@ fn windows_with_carry(bb: &[u8], nn: uint, fn make_sequence_processor(sz: uint, from_parent: pipes::Port<~[u8]>, to_parent: pipes::Chan<~str>) { - let freqs: hashmap<~[u8], uint> = map::bytes_hash(); + let freqs: HashMap<~[u8], uint> = map::bytes_hash(); let mut carry: ~[u8] = ~[]; let mut total: uint = 0u; diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs index d5f9860caa1..e6edb8754db 100644 --- a/src/test/bench/shootout-k-nucleotide.rs +++ b/src/test/bench/shootout-k-nucleotide.rs @@ -4,13 +4,13 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; use std::sort; use io::ReaderUtil; use cmp::Ord; // given a map, print a sorted version of it -fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { +fn sort_and_fmt(mm: HashMap<~[u8], uint>, total: uint) -> ~str { fn pct(xx: uint, yy: uint) -> float { return (xx as float) * 100f / (yy as float); } @@ -56,7 +56,7 @@ fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str { } // given a map, search for the frequency of a pattern -fn find(mm: hashmap<~[u8], uint>, key: ~str) -> uint { +fn find(mm: HashMap<~[u8], uint>, key: ~str) -> uint { match mm.find(str::to_bytes(str::to_lower(key))) { option::None => { return 0u; } option::Some(num) => { return num; } @@ -64,7 +64,7 @@ fn find(mm: hashmap<~[u8], uint>, key: ~str) -> uint { } // given a map, increment the counter for a key -fn update_freq(mm: hashmap<~[u8], uint>, key: &[u8]) { +fn update_freq(mm: HashMap<~[u8], uint>, key: &[u8]) { let key = vec::slice(key, 0, key.len()); match mm.find(key) { option::None => { mm.insert(key, 1u ); } @@ -91,7 +91,7 @@ fn windows_with_carry(bb: &[u8], nn: uint, fn make_sequence_processor(sz: uint, from_parent: comm::Port<~[u8]>, to_parent: comm::Chan<~str>) { - let freqs: hashmap<~[u8], uint> = map::bytes_hash(); + let freqs: HashMap<~[u8], uint> = map::bytes_hash(); let mut carry: ~[u8] = ~[]; let mut total: uint = 0u; diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs index 879825fa0ae..19f1c6a4536 100644 --- a/src/test/bench/shootout-mandelbrot.rs +++ b/src/test/bench/shootout-mandelbrot.rs @@ -14,7 +14,7 @@ use std; use io::WriterUtil; -use std::map::hashmap; +use std::map::HashMap; struct cmplx { re: f64, diff --git a/src/test/bench/task-perf-word-count-generic.rs b/src/test/bench/task-perf-word-count-generic.rs index a2d816ec369..b76a0c4dfc5 100644 --- a/src/test/bench/task-perf-word-count-generic.rs +++ b/src/test/bench/task-perf-word-count-generic.rs @@ -16,7 +16,7 @@ use option = option; use option::Some; use option::None; use std::map; -use std::map::hashmap; +use std::map::HashMap; use hash::Hash; use io::WriterUtil; @@ -173,7 +173,7 @@ mod map_reduce { input: K1) { // log(error, "map_task " + input); - let intermediates = map::hashmap(); + let intermediates = map::HashMap(); do map(input) |key, val| { let mut c = None; @@ -250,7 +250,7 @@ mod map_reduce { // This task becomes the master control task. It task::_spawns // to do the rest. - let reducers = map::hashmap(); + let reducers = map::HashMap(); let mut tasks = start_mappers(map, ctrl, inputs); let mut num_mappers = vec::len(inputs) as int; diff --git a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs index 49ea43439d1..c983f895338 100644 --- a/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs +++ b/src/test/compile-fail/borrowck-borrowed-uniq-rvalue.rs @@ -1,11 +1,11 @@ //buggy.rs use std; -use std::map::hashmap; +use std::map::HashMap; use std::map; fn main() { - let buggy_map :hashmap = - hashmap::(); + let buggy_map :HashMap = + HashMap::(); buggy_map.insert(42, ~1); //~ ERROR illegal borrow // but it is ok if we use a temporary diff --git a/src/test/compile-fail/for-loop-decl.rs b/src/test/compile-fail/for-loop-decl.rs index e14e1fdc7ef..f9696dd2870 100644 --- a/src/test/compile-fail/for-loop-decl.rs +++ b/src/test/compile-fail/for-loop-decl.rs @@ -1,9 +1,9 @@ // error-pattern: mismatched types use std; -use std::map::hashmap; +use std::map::HashMap; use std::bitv; -type fn_info = {vars: hashmap}; +type fn_info = {vars: HashMap}; type var_info = {a: uint, b: uint}; fn bitv_to_str(enclosing: fn_info, v: ~bitv::Bitv) -> str { diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs index 0a714b12847..dce7d256033 100644 --- a/src/test/compile-fail/map-types.rs +++ b/src/test/compile-fail/map-types.rs @@ -1,12 +1,12 @@ use std; use std::map; -use std::map::hashmap; -use std::map::map; +use std::map::HashMap; +use std::map::Map; // Test that trait types printed in error msgs include the type arguments. fn main() { - let x: map<~str,~str> = map::str_hash::<~str>() as map::<~str,~str>; - let y: map = x; - //~^ ERROR mismatched types: expected `@std::map::map` + let x: Map<~str,~str> = map::str_hash::<~str>() as Map::<~str,~str>; + let y: Map = x; + //~^ ERROR mismatched types: expected `@std::map::Map` } diff --git a/src/test/run-fail/unwind-misc-1.rs b/src/test/run-fail/unwind-misc-1.rs index 5af2191c151..b0af04cc59f 100644 --- a/src/test/run-fail/unwind-misc-1.rs +++ b/src/test/run-fail/unwind-misc-1.rs @@ -2,11 +2,11 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; fn main() { let count = @mut 0u; - let map = map::hashmap(); + let map = map::HashMap(); let mut arr = ~[]; for uint::range(0u, 10u) |i| { arr += ~[@~"key stuff"]; diff --git a/src/test/run-pass/class-impl-very-parameterized-trait.rs b/src/test/run-pass/class-impl-very-parameterized-trait.rs index ce6074ad4a7..b4d47f86e1a 100644 --- a/src/test/run-pass/class-impl-very-parameterized-trait.rs +++ b/src/test/run-pass/class-impl-very-parameterized-trait.rs @@ -40,7 +40,7 @@ impl cat { } } -impl cat : map { +impl cat : Map { pure fn size() -> uint { self.meows as uint } fn insert(+k: int, +_v: T) -> bool { self.meows += k; diff --git a/src/test/run-pass/extern-mod-syntax.rs b/src/test/run-pass/extern-mod-syntax.rs index 719cda244b5..7798bdc3d0a 100644 --- a/src/test/run-pass/extern-mod-syntax.rs +++ b/src/test/run-pass/extern-mod-syntax.rs @@ -1,5 +1,5 @@ extern mod std; -use std::map::hashmap; +use std::map::HashMap; fn main() { io::println("Hello world!"); diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 6ae9cd430b4..98bcc8ed36f 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -10,7 +10,7 @@ use option = option; use option::Some; use option::None; use std::map; -use std::map::hashmap; +use std::map::HashMap; use comm::Chan; use comm::Port; use comm::send; @@ -38,7 +38,7 @@ mod map_reduce { fn map_task(ctrl: Chan, input: ~str) { let intermediates = map::str_hash(); - fn emit(im: map::hashmap<~str, int>, ctrl: Chan, key: ~str, + fn emit(im: map::HashMap<~str, int>, ctrl: Chan, key: ~str, val: ~str) { let mut c; match im.find(key) { @@ -65,7 +65,7 @@ mod map_reduce { // This task becomes the master control task. It spawns others // to do the rest. - let mut reducers: map::hashmap<~str, int>; + let mut reducers: map::HashMap<~str, int>; reducers = map::str_hash(); diff --git a/src/test/run-pass/issue-1696.rs b/src/test/run-pass/issue-1696.rs index de0a1f23b52..0c24f791568 100644 --- a/src/test/run-pass/issue-1696.rs +++ b/src/test/run-pass/issue-1696.rs @@ -1,6 +1,6 @@ use std; use std::map; -use std::map::hashmap; +use std::map::HashMap; fn main() { let m = map::bytes_hash(); diff --git a/src/test/run-pass/issue-2804-2.rs b/src/test/run-pass/issue-2804-2.rs index 4b0637c586d..062e086d00c 100644 --- a/src/test/run-pass/issue-2804-2.rs +++ b/src/test/run-pass/issue-2804-2.rs @@ -1,9 +1,9 @@ // Minimized version of issue-2804.rs. Both check that callee IDs don't // clobber the previous node ID in a macro expr use std; -use std::map::hashmap; +use std::map::HashMap; -fn add_interfaces(managed_ip: ~str, device: std::map::hashmap<~str, int>) { +fn add_interfaces(managed_ip: ~str, device: std::map::HashMap<~str, int>) { error!("%s, %?", managed_ip, device[~"interfaces"]); } diff --git a/src/test/run-pass/issue-2804.rs b/src/test/run-pass/issue-2804.rs index 5ed46fc3df0..36620108db9 100644 --- a/src/test/run-pass/issue-2804.rs +++ b/src/test/run-pass/issue-2804.rs @@ -1,6 +1,6 @@ use std; use io::WriterUtil; -use std::map::hashmap; +use std::map::HashMap; enum object { @@ -8,7 +8,7 @@ enum object int_value(i64), } -fn lookup(table: std::map::hashmap<~str, std::json::Json>, key: ~str, default: ~str) -> ~str +fn lookup(table: std::map::HashMap<~str, std::json::Json>, key: ~str, default: ~str) -> ~str { match table.find(key) { @@ -47,7 +47,7 @@ fn add_interface(store: int, managed_ip: ~str, data: std::json::Json) -> (~str, } } -fn add_interfaces(store: int, managed_ip: ~str, device: std::map::hashmap<~str, std::json::Json>) -> ~[(~str, object)] +fn add_interfaces(store: int, managed_ip: ~str, device: std::map::HashMap<~str, std::json::Json>) -> ~[(~str, object)] { match device[~"interfaces"] { -- cgit 1.4.1-3-g733a5