1
Fork 0

Remove modes from map API and replace with regions.

API is (for now) mostly by value, there are options to use it by
reference if you like.  Hash and equality functions must be pure
and by reference (forward looking to the day when something
like send_map becomes the standard map).
This commit is contained in:
Niko Matsakis 2012-08-02 15:42:56 -07:00
parent 476ce459bd
commit 97452c0ca1
62 changed files with 578 additions and 473 deletions

View file

@ -588,18 +588,24 @@ impl of to_json for @~str {
fn to_json() -> json { string(self) }
}
impl <A: to_json copy, B: to_json copy> of to_json for (A, B) {
impl <A: to_json, B: to_json> of to_json for (A, B) {
fn to_json() -> json {
let (a, b) = self;
list(@~[a.to_json(), b.to_json()])
alt self {
(a, b) => {
list(@~[a.to_json(), b.to_json()])
}
}
}
}
impl <A: to_json copy, B: to_json copy, C: to_json copy>
impl <A: to_json, B: to_json, C: to_json>
of to_json for (A, B, C) {
fn to_json() -> json {
let (a, b, c) = self;
list(@~[a.to_json(), b.to_json(), c.to_json()])
alt self {
(a, b, c) => {
list(@~[a.to_json(), b.to_json(), c.to_json()])
}
}
}
}