1
Fork 0

core: add str::each{,i}_reverse

This commit is contained in:
Erick Tryzelaar 2013-03-13 11:29:05 -07:00
parent 8d5ab3061a
commit cefecd8601
4 changed files with 223 additions and 91 deletions

View file

@ -14,20 +14,14 @@
//! json serialization
use core::prelude::*;
use core::io::{WriterUtil, ReaderUtil};
use core::hashmap::linear::LinearMap;
use serialize::Encodable;
use serialize;
use sort::Sort;
use core::char;
use core::cmp::{Eq, Ord};
use core::float;
use core::io::{WriterUtil, ReaderUtil};
use core::io;
use core::prelude::*;
use core::hashmap::linear::LinearMap;
use core::str;
use core::to_str;
/// Represents a json value
pub enum Json {
Number(float),
@ -49,7 +43,7 @@ pub struct Error {
fn escape_str(s: &str) -> ~str {
let mut escaped = ~"\"";
for str::chars_each(s) |c| {
for str::each_char(s) |c| {
match c {
'"' => escaped += ~"\\\"",
'\\' => escaped += ~"\\\\",