Skip to content

Commit d727f99

Browse files
Oliver 'ker' SchneiderOliver Schneider
Oliver 'ker' Schneider
authored and
Oliver Schneider
committed
lower FnMut to FnOnce since json-hack is no longer required
Conflicts: src/libserialize/serialize.rs
1 parent f015a3b commit d727f99

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librbml/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,8 @@ pub mod writer {
10591059
self.end_tag()
10601060
}
10611061

1062-
fn emit_map_elt_key<F>(&mut self, _idx: uint, mut f: F) -> EncodeResult where
1063-
F: FnMut(&mut Encoder<'a, W>) -> EncodeResult,
1062+
fn emit_map_elt_key<F>(&mut self, _idx: uint, f: F) -> EncodeResult where
1063+
F: FnOnce(&mut Encoder<'a, W>) -> EncodeResult,
10641064
{
10651065

10661066
try!(self.start_tag(EsMapKey as uint));

src/libserialize/json.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,8 @@ impl<'a> ::Encoder for Encoder<'a> {
668668
Ok(())
669669
}
670670

671-
fn emit_map_elt_key<F>(&mut self, idx: uint, mut f: F) -> EncodeResult where
672-
F: FnMut(&mut Encoder<'a>) -> EncodeResult,
671+
fn emit_map_elt_key<F>(&mut self, idx: uint, f: F) -> EncodeResult where
672+
F: FnOnce(&mut Encoder<'a>) -> EncodeResult,
673673
{
674674
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
675675
if idx != 0 { try!(write!(self.writer, ",")) }
@@ -961,8 +961,8 @@ impl<'a> ::Encoder for PrettyEncoder<'a> {
961961
Ok(())
962962
}
963963

964-
fn emit_map_elt_key<F>(&mut self, idx: uint, mut f: F) -> EncodeResult where
965-
F: FnMut(&mut PrettyEncoder<'a>) -> EncodeResult,
964+
fn emit_map_elt_key<F>(&mut self, idx: uint, f: F) -> EncodeResult where
965+
F: FnOnce(&mut PrettyEncoder<'a>) -> EncodeResult,
966966
{
967967
if self.is_emitting_map_key { return Err(EncoderError::BadHashmapKey); }
968968
if idx == 0 {

src/libserialize/serialize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub trait Encoder {
9898
fn emit_map<F>(&mut self, len: uint, f: F) -> Result<(), Self::Error>
9999
where F: FnOnce(&mut Self) -> Result<(), Self::Error>;
100100
fn emit_map_elt_key<F>(&mut self, idx: uint, f: F) -> Result<(), Self::Error>
101-
where F: FnMut(&mut Self) -> Result<(), Self::Error>;
101+
where F: FnOnce(&mut Self) -> Result<(), Self::Error>;
102102
fn emit_map_elt_val<F>(&mut self, idx: uint, f: F) -> Result<(), Self::Error>
103103
where F: FnOnce(&mut Self) -> Result<(), Self::Error>;
104104
}

0 commit comments

Comments
 (0)