libstd: Remove some residual mutable fields
This commit is contained in:
parent
d12d25534b
commit
c7522417d4
@ -600,11 +600,18 @@ pub mod writer {
|
||||
use core::vec;
|
||||
|
||||
// ebml writing
|
||||
#[cfg(stage0)]
|
||||
pub struct Encoder {
|
||||
writer: @io::Writer,
|
||||
priv mut size_positions: ~[uint],
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
pub struct Encoder {
|
||||
writer: @io::Writer,
|
||||
priv size_positions: ~[uint],
|
||||
}
|
||||
|
||||
fn write_sized_vuint(w: @io::Writer, n: uint, size: uint) {
|
||||
match size {
|
||||
1u => w.write(&[0x80u8 | (n as u8)]),
|
||||
@ -625,9 +632,22 @@ pub mod writer {
|
||||
fail!(fmt!("vint to write too big: %?", n));
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
pub fn Encoder(w: @io::Writer) -> Encoder {
|
||||
let size_positions: ~[uint] = ~[];
|
||||
Encoder { writer: w, mut size_positions: size_positions }
|
||||
Encoder {
|
||||
writer: w,
|
||||
mut size_positions: size_positions
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
pub fn Encoder(w: @io::Writer) -> Encoder {
|
||||
let size_positions: ~[uint] = ~[];
|
||||
Encoder {
|
||||
writer: w,
|
||||
size_positions: size_positions
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME (#2741): Provide a function to write the standard ebml header.
|
||||
|
@ -220,11 +220,18 @@ impl serialize::Encoder for Encoder {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
pub struct PrettyEncoder {
|
||||
priv wr: @io::Writer,
|
||||
priv mut indent: uint,
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
pub struct PrettyEncoder {
|
||||
priv wr: @io::Writer,
|
||||
priv indent: uint,
|
||||
}
|
||||
|
||||
pub fn PrettyEncoder(wr: @io::Writer) -> PrettyEncoder {
|
||||
PrettyEncoder {
|
||||
wr: wr,
|
||||
@ -838,10 +845,16 @@ pub fn from_str(s: &str) -> Result<Json, Error> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
pub struct Decoder {
|
||||
priv mut stack: ~[Json],
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
pub struct Decoder {
|
||||
priv stack: ~[Json],
|
||||
}
|
||||
|
||||
pub fn Decoder(json: Json) -> Decoder {
|
||||
Decoder {
|
||||
stack: ~[json]
|
||||
|
Loading…
x
Reference in New Issue
Block a user