1
Fork 0

std: add a io::with_str_reader fn to remove a str copy

This commit is contained in:
Erick Tryzelaar 2012-02-29 10:48:57 -08:00
parent 5812bebf87
commit 1404a864a4
2 changed files with 25 additions and 8 deletions

View file

@ -490,7 +490,7 @@ Function: from_str
Deserializes a json value from a string.
*/
fn from_str(s: str) -> result::t<json, error> {
from_reader(io::string_reader(s))
io::with_str_reader(s, from_reader)
}
/*