Fallout from collection conventions

This commit is contained in:
Alexis Beingessner 2014-11-06 12:25:16 -05:00
parent cf3b2e4fe6
commit eec145be3f
101 changed files with 418 additions and 417 deletions

View file

@ -139,7 +139,7 @@ pub fn can_reach<S,H:Hasher<S>,T:Eq+Clone+Hash<S>>(
let mut queue = vec!(source);
let mut i = 0;
while i < queue.len() {
match edges_map.find(&queue[i]) {
match edges_map.get(&queue[i]) {
Some(edges) => {
for target in edges.iter() {
if *target == destination {
@ -200,7 +200,7 @@ pub fn memoized_with_key<T, K: Hash<S> + Eq, U: Clone, S, H: Hasher<S>>(
k: |&T| -> K
) -> U {
let key = k(&arg);
let result = cache.borrow().find(&key).map(|result| result.clone());
let result = cache.borrow().get(&key).map(|result| result.clone());
match result {
Some(result) => result,
None => {

View file

@ -451,7 +451,7 @@ pub fn ty_to_string(cx: &ctxt, typ: t) -> String {
ty_str => "str".to_string(),
ty_unboxed_closure(ref did, _, ref substs) => {
let unboxed_closures = cx.unboxed_closures.borrow();
unboxed_closures.find(did).map(|cl| {
unboxed_closures.get(did).map(|cl| {
closure_to_string(cx, &cl.closure_type.subst(cx, substs))
}).unwrap_or_else(|| "closure".to_string())
}
@ -1108,7 +1108,7 @@ impl UserString for ty::ParamBounds {
impl UserString for ty::ExistentialBounds {
fn user_string(&self, tcx: &ctxt) -> String {
if self.builtin_bounds.contains_elem(ty::BoundSend) &&
if self.builtin_bounds.contains(&ty::BoundSend) &&
self.region_bound == ty::ReStatic
{ // Region bound is implied by builtin bounds:
return self.builtin_bounds.repr(tcx);
@ -1277,7 +1277,7 @@ impl UserString for ParamTy {
fn user_string(&self, tcx: &ctxt) -> String {
let id = self.idx;
let did = self.def_id;
let ident = match tcx.ty_param_defs.borrow().find(&did.node) {
let ident = match tcx.ty_param_defs.borrow().get(&did.node) {
Some(def) => token::get_name(def.name).get().to_string(),
// This can only happen when a type mismatch error happens and