From ee7016d95f5ca8f6f27e83ba8e040ee95813840a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 27 Mar 2014 15:13:35 -0700 Subject: [PATCH] serialize: Switch field privacy as necessary --- src/libserialize/ebml.rs | 22 +++++++++++----------- src/libserialize/json.rs | 16 ++++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/libserialize/ebml.rs b/src/libserialize/ebml.rs index cf1720041cc..a6356e34af3 100644 --- a/src/libserialize/ebml.rs +++ b/src/libserialize/ebml.rs @@ -20,9 +20,9 @@ use std::str; // Common data structures #[deriving(Clone)] pub struct Doc<'a> { - data: &'a [u8], - start: uint, - end: uint, + pub data: &'a [u8], + pub start: uint, + pub end: uint, } impl<'doc> Doc<'doc> { @@ -40,8 +40,8 @@ impl<'doc> Doc<'doc> { } pub struct TaggedDoc<'a> { - priv tag: uint, - doc: Doc<'a>, + tag: uint, + pub doc: Doc<'a>, } pub enum EbmlEncoderTag { @@ -117,8 +117,8 @@ pub mod reader { ) pub struct Res { - val: uint, - next: uint + pub val: uint, + pub next: uint } #[inline(never)] @@ -291,8 +291,8 @@ pub mod reader { pub fn doc_as_i64(d: Doc) -> i64 { doc_as_u64(d) as i64 } pub struct Decoder<'a> { - priv parent: Doc<'a>, - priv pos: uint, + parent: Doc<'a>, + pos: uint, } pub fn Decoder<'a>(d: Doc<'a>) -> Decoder<'a> { @@ -635,8 +635,8 @@ pub mod writer { // ebml writing pub struct Encoder<'a, W> { - writer: &'a mut W, - priv size_positions: ~[uint], + pub writer: &'a mut W, + size_positions: ~[uint], } fn write_sized_vuint(w: &mut W, n: uint, size: uint) -> EncodeResult { diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 996d17fd88f..2d3e6bc86eb 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -298,7 +298,7 @@ fn spaces(n: uint) -> ~str { /// A structure for implementing serialization to JSON. pub struct Encoder<'a> { - priv wr: &'a mut io::Writer, + wr: &'a mut io::Writer, } impl<'a> Encoder<'a> { @@ -504,8 +504,8 @@ impl<'a> ::Encoder for Encoder<'a> { /// Another encoder for JSON, but prints out human-readable JSON instead of /// compact data pub struct PrettyEncoder<'a> { - priv wr: &'a mut io::Writer, - priv indent: uint, + wr: &'a mut io::Writer, + indent: uint, } impl<'a> PrettyEncoder<'a> { @@ -899,10 +899,10 @@ impl Json { } pub struct Parser { - priv rdr: T, - priv ch: Option, - priv line: uint, - priv col: uint, + rdr: T, + ch: Option, + line: uint, + col: uint, } impl> Parser { @@ -1298,7 +1298,7 @@ pub fn from_str(s: &str) -> DecodeResult { /// A structure to decode JSON to values in rust. pub struct Decoder { - priv stack: ~[Json], + stack: ~[Json], } impl Decoder {