diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-06-10 00:49:59 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-06-13 11:30:45 -0700 |
| commit | ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a (patch) | |
| tree | 55c2ee5be0986c2489879022d4788d6c3ac2c964 /src/libstd/map.rs | |
| parent | bdd20000665a35e14b4ec2c54f893fc80fe451ef (diff) | |
| download | rust-ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a.tar.gz rust-ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a.zip | |
Box AST idents
Diffstat (limited to 'src/libstd/map.rs')
| -rw-r--r-- | src/libstd/map.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/map.rs b/src/libstd/map.rs index 140349089a8..bfa1fb4a7b6 100644 --- a/src/libstd/map.rs +++ b/src/libstd/map.rs @@ -2,6 +2,7 @@ import chained::hashmap; export hashmap, hashfn, eqfn, set, map, chained, hashmap, str_hash; +export box_str_hash; export bytes_hash, int_hash, uint_hash, set_add; export hash_from_vec, hash_from_strs, hash_from_bytes; export hash_from_ints, hash_from_uints; @@ -292,6 +293,11 @@ fn str_hash<V: copy>() -> hashmap<str, V> { ret hashmap(str::hash, str::eq); } +#[doc = "Construct a hashmap for boxed string keys"] +fn box_str_hash<V: copy>() -> hashmap<@str, V> { + ret hashmap({|x: @str|str::hash(*x)}, {|x,y|str::eq(*x,*y)}); +} + #[doc = "Construct a hashmap for byte string keys"] fn bytes_hash<V: copy>() -> hashmap<[u8], V> { ret hashmap(vec::u8::hash, vec::u8::eq); |
