lower FnMut to FnOnce since json-hack is no longer required
Conflicts: src/libserialize/serialize.rs
This commit is contained in:
parent
f015a3b871
commit
d727f99107
3 changed files with 7 additions and 7 deletions
|
@ -1059,8 +1059,8 @@ pub mod writer {
|
||||||
self.end_tag()
|
self.end_tag()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_map_elt_key<F>(&mut self, _idx: uint, mut f: F) -> EncodeResult where
|
fn emit_map_elt_key<F>(&mut self, _idx: uint, f: F) -> EncodeResult where
|
||||||
F: FnMut(&mut Encoder<'a, W>) -> EncodeResult,
|
F: FnOnce(&mut Encoder<'a, W>) -> EncodeResult,
|
||||||
{
|
{
|
||||||
|
|
||||||
try!(self.start_tag(EsMapKey as uint));
|
try!(self.start_tag(EsMapKey as uint));
|
||||||
|
|
|
@ -668,8 +668,8 @@ impl<'a> ::Encoder for Encoder<'a> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_map_elt_key<F>(&mut self, idx: uint, mut f: F) -> EncodeResult where
|
fn emit_map_elt_key<F>(&mut self, idx: uint, f: F) -> EncodeResult where
|
||||||
F: FnMut(&mut Encoder<'a>) -> EncodeResult,
|
F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
|
||||||
{
|
{
|
||||||
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
|
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
|
||||||
if idx != 0 { try!(write!(self.writer, ",")) }
|
if idx != 0 { try!(write!(self.writer, ",")) }
|
||||||
|
@ -961,8 +961,8 @@ impl<'a> ::Encoder for PrettyEncoder<'a> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn emit_map_elt_key<F>(&mut self, idx: uint, mut f: F) -> EncodeResult where
|
fn emit_map_elt_key<F>(&mut self, idx: uint, f: F) -> EncodeResult where
|
||||||
F: FnMut(&mut PrettyEncoder<'a>) -> EncodeResult,
|
F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
|
||||||
{
|
{
|
||||||
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
|
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
|
||||||
if idx == 0 {
|
if idx == 0 {
|
||||||
|
|
|
@ -98,7 +98,7 @@ pub trait Encoder {
|
||||||
fn emit_map<F>(&mut self, len: uint, f: F) -> Result<(), Self::Error>
|
fn emit_map<F>(&mut self, len: uint, f: F) -> Result<(), Self::Error>
|
||||||
where F: FnOnce(&mut Self) -> Result<(), Self::Error>;
|
where F: FnOnce(&mut Self) -> Result<(), Self::Error>;
|
||||||
fn emit_map_elt_key<F>(&mut self, idx: uint, f: F) -> Result<(), Self::Error>
|
fn emit_map_elt_key<F>(&mut self, idx: uint, f: F) -> Result<(), Self::Error>
|
||||||
where F: FnMut(&mut Self) -> Result<(), Self::Error>;
|
where F: FnOnce(&mut Self) -> Result<(), Self::Error>;
|
||||||
fn emit_map_elt_val<F>(&mut self, idx: uint, f: F) -> Result<(), Self::Error>
|
fn emit_map_elt_val<F>(&mut self, idx: uint, f: F) -> Result<(), Self::Error>
|
||||||
where F: FnOnce(&mut Self) -> Result<(), Self::Error>;
|
where F: FnOnce(&mut Self) -> Result<(), Self::Error>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue