From 2ea9c8df0f7c9ee72913883128b37d0a80d2f4f6 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Wed, 11 Jul 2012 23:42:26 -0700 Subject: Accept prefix notation for writing the types of str/~ and friends. --- src/libstd/json.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libstd/json.rs') diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 9f51ab157b7..da86b9d4df0 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -29,7 +29,7 @@ export null; /// Represents a json value enum json { num(float), - string(@str), + string(@str/~), boolean(bool), list(@~[json]), dict(map::hashmap), @@ -39,7 +39,7 @@ enum json { type error = { line: uint, col: uint, - msg: @str, + msg: @str/~, }; /// Serializes a json value into a io::writer @@ -324,7 +324,7 @@ impl parser for parser { ok(res) } - fn parse_str() -> result<@str, error> { + fn parse_str() -> result<@str/~, error> { let mut escape = false; let mut res = ""; @@ -579,7 +579,7 @@ impl of to_json for str { fn to_json() -> json { string(@copy self) } } -impl of to_json for @str { +impl of to_json for @str/~ { fn to_json() -> json { string(self) } } -- cgit 1.4.1-3-g733a5