about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-03-27 15:13:35 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-03-31 15:47:36 -0700
commitee7016d95f5ca8f6f27e83ba8e040ee95813840a (patch)
tree2938362879c57b42a328ea35de9647712ee9f0cc
parente5a49a2fcfbc98ec4c63654bab5d6b0da028fd79 (diff)
downloadrust-ee7016d95f5ca8f6f27e83ba8e040ee95813840a.tar.gz
rust-ee7016d95f5ca8f6f27e83ba8e040ee95813840a.zip
serialize: Switch field privacy as necessary
-rw-r--r--src/libserialize/ebml.rs22
-rw-r--r--src/libserialize/json.rs16
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: Writer>(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<io::IoError> 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<T> {
-    priv rdr: T,
-    priv ch: Option<char>,
-    priv line: uint,
-    priv col: uint,
+    rdr: T,
+    ch: Option<char>,
+    line: uint,
+    col: uint,
 }
 
 impl<T: Iterator<char>> Parser<T> {
@@ -1298,7 +1298,7 @@ pub fn from_str(s: &str) -> DecodeResult<Json> {
 
 /// A structure to decode JSON to values in rust.
 pub struct Decoder {
-    priv stack: ~[Json],
+    stack: ~[Json],
 }
 
 impl Decoder {