Skip to content

Commit 88d9d41

Browse files
committed
oldmap: remove the legacy each_value method
1 parent 643479f commit 88d9d41

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

src/libcargo/cargo.rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ pub fn configure(opts: Options) -> Cargo {
748748
}
749749

750750
pub fn for_each_package(c: &Cargo, b: fn(s: @Source, p: &Package)) {
751-
for c.sources.each_value |v| {
751+
for c.sources.each_value_ref |&v| {
752752
for v.packages.each |p| {
753753
b(v, p);
754754
}
@@ -1569,7 +1569,7 @@ pub fn cmd_list(c: &Cargo) {
15691569
}
15701570
}
15711571
} else {
1572-
for c.sources.each_value |v| {
1572+
for c.sources.each_value_ref |&v| {
15731573
print_source(v);
15741574
}
15751575
}
@@ -1675,7 +1675,7 @@ pub fn copy_warn(srcfile: &Path, destfile: &Path) {
16751675

16761676
pub fn cmd_sources(c: &Cargo) {
16771677
if vec::len(c.opts.free) < 3u {
1678-
for c.sources.each_value |v| {
1678+
for c.sources.each_value_ref |&v| {
16791679
info(fmt!("%s (%s) via %s",
16801680
v.name, v.url, v.method));
16811681
}

src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub fn get_dep_hashes(cstore: CStore) -> ~[~str] {
148148
type crate_hash = {name: ~str, hash: ~str};
149149
let mut result = ~[];
150150

151-
for p(cstore).use_crate_map.each_value |cnum| {
151+
for p(cstore).use_crate_map.each_value_ref |&cnum| {
152152
let cdata = cstore::get_crate_data(cstore, cnum);
153153
let hash = decoder::get_crate_hash(cdata.data);
154154
debug!("Add hash[%s]: %s", cdata.name, hash);

src/librustc/middle/trans/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ pub fn store_non_ref_bindings(bcx: block,
10851085
*/
10861086
10871087
let mut bcx = bcx;
1088-
for data.bindings_map.each_value |binding_info| {
1088+
for data.bindings_map.each_value_ref |&binding_info| {
10891089
match binding_info.trmode {
10901090
TrByValue(is_move, lldest) => {
10911091
let llval = Load(bcx, binding_info.llmatch); // get a T*
@@ -1119,7 +1119,7 @@ pub fn insert_lllocals(bcx: block,
11191119
* the `fcx.lllocals` map. If add_cleans is true, then adds cleanups for
11201120
* the bindings. */
11211121
1122-
for data.bindings_map.each_value |binding_info| {
1122+
for data.bindings_map.each_value_ref |&binding_info| {
11231123
let llval = match binding_info.trmode {
11241124
// By value bindings: use the stack slot that we
11251125
// copied/moved the value into
@@ -1191,7 +1191,7 @@ pub fn compile_guard(bcx: block,
11911191
11921192
fn drop_bindings(bcx: block, data: &ArmData) -> block {
11931193
let mut bcx = bcx;
1194-
for data.bindings_map.each_value |binding_info| {
1194+
for data.bindings_map.each_value_ref |&binding_info| {
11951195
match binding_info.trmode {
11961196
TrByValue(_, llval) => {
11971197
bcx = glue::drop_ty(bcx, llval, binding_info.ty);

src/libstd/oldmap.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,6 @@ pub mod chained {
324324
self.each_key_ref(|p| blk(*p))
325325
}
326326

327-
pure fn each_value(blk: fn(value: V) -> bool) {
328-
self.each_value_ref(|p| blk(*p))
329-
}
330-
331327
pure fn each_ref(blk: fn(key: &K, value: &V) -> bool) {
332328
for self.each_entry |entry| {
333329
if !blk(&entry.key, &entry.value) { break; }

0 commit comments

Comments
 (0)