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:
parent
476ce459bd
commit
97452c0ca1
62 changed files with 578 additions and 473 deletions
|
@ -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()])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue