std: add a io::with_str_reader fn to remove a str copy
This commit is contained in:
parent
5812bebf87
commit
1404a864a4
2 changed files with 25 additions and 8 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue