Skip to content

Instantly share code, notes, and snippets.

@catamorphism
Created August 22, 2012 21:49
Show Gist options
  • Select an option

  • Save catamorphism/3429712 to your computer and use it in GitHub Desktop.

Select an option

Save catamorphism/3429712 to your computer and use it in GitHub Desktop.
pure fn bucket_for_key_with_hash(
buckets: &[option<Bucket<K,V>>],
hash: uint,
k: &K) -> SearchResult<K, V> {
let _ = for self.bucket_sequence(hash) |i| {
match buckets[i] {
some(bkt) => if bkt.hash == hash && self.eqfn(k, &bkt.key) {
return Found(some(&bkt))
},
none => return Found(none)
}
};
return TableFull;
}
/Users/TimChevalier/rust/src/libcore/send_map.rs:115:42: 115:45 error: illegal borrow: borrowed pointer must be valid for the lifetime & as defined on the block at 110:41, but the borrowed value is only valid for the alt at 113:16
/Users/TimChevalier/rust/src/libcore/send_map.rs:115 return Found(some(&bkt))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment