Skip to content

Commit ee7016d

Browse files
committed
serialize: Switch field privacy as necessary
1 parent e5a49a2 commit ee7016d

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/libserialize/ebml.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ use std::str;
2020
// Common data structures
2121
#[deriving(Clone)]
2222
pub struct Doc<'a> {
23-
data: &'a [u8],
24-
start: uint,
25-
end: uint,
23+
pub data: &'a [u8],
24+
pub start: uint,
25+
pub end: uint,
2626
}
2727

2828
impl<'doc> Doc<'doc> {
@@ -40,8 +40,8 @@ impl<'doc> Doc<'doc> {
4040
}
4141

4242
pub struct TaggedDoc<'a> {
43-
priv tag: uint,
44-
doc: Doc<'a>,
43+
tag: uint,
44+
pub doc: Doc<'a>,
4545
}
4646

4747
pub enum EbmlEncoderTag {
@@ -117,8 +117,8 @@ pub mod reader {
117117
)
118118

119119
pub struct Res {
120-
val: uint,
121-
next: uint
120+
pub val: uint,
121+
pub next: uint
122122
}
123123

124124
#[inline(never)]
@@ -291,8 +291,8 @@ pub mod reader {
291291
pub fn doc_as_i64(d: Doc) -> i64 { doc_as_u64(d) as i64 }
292292

293293
pub struct Decoder<'a> {
294-
priv parent: Doc<'a>,
295-
priv pos: uint,
294+
parent: Doc<'a>,
295+
pos: uint,
296296
}
297297

298298
pub fn Decoder<'a>(d: Doc<'a>) -> Decoder<'a> {
@@ -635,8 +635,8 @@ pub mod writer {
635635

636636
// ebml writing
637637
pub struct Encoder<'a, W> {
638-
writer: &'a mut W,
639-
priv size_positions: ~[uint],
638+
pub writer: &'a mut W,
639+
size_positions: ~[uint],
640640
}
641641

642642
fn write_sized_vuint<W: Writer>(w: &mut W, n: uint, size: uint) -> EncodeResult {

src/libserialize/json.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ fn spaces(n: uint) -> ~str {
298298

299299
/// A structure for implementing serialization to JSON.
300300
pub struct Encoder<'a> {
301-
priv wr: &'a mut io::Writer,
301+
wr: &'a mut io::Writer,
302302
}
303303

304304
impl<'a> Encoder<'a> {
@@ -504,8 +504,8 @@ impl<'a> ::Encoder<io::IoError> for Encoder<'a> {
504504
/// Another encoder for JSON, but prints out human-readable JSON instead of
505505
/// compact data
506506
pub struct PrettyEncoder<'a> {
507-
priv wr: &'a mut io::Writer,
508-
priv indent: uint,
507+
wr: &'a mut io::Writer,
508+
indent: uint,
509509
}
510510

511511
impl<'a> PrettyEncoder<'a> {
@@ -899,10 +899,10 @@ impl Json {
899899
}
900900

901901
pub struct Parser<T> {
902-
priv rdr: T,
903-
priv ch: Option<char>,
904-
priv line: uint,
905-
priv col: uint,
902+
rdr: T,
903+
ch: Option<char>,
904+
line: uint,
905+
col: uint,
906906
}
907907

908908
impl<T: Iterator<char>> Parser<T> {
@@ -1298,7 +1298,7 @@ pub fn from_str(s: &str) -> DecodeResult<Json> {
12981298

12991299
/// A structure to decode JSON to values in rust.
13001300
pub struct Decoder {
1301-
priv stack: ~[Json],
1301+
stack: ~[Json],
13021302
}
13031303

13041304
impl Decoder {

0 commit comments

Comments
 (0)