@@ -490,7 +490,7 @@ macro_rules! emit_enquoted_if_mapkey {
490
490
impl < ' a > :: Encoder for Encoder < ' a > {
491
491
type Error = EncoderError ;
492
492
493
- fn emit_nil ( & mut self ) -> EncodeResult {
493
+ fn emit_unit ( & mut self ) -> EncodeResult {
494
494
if self . is_emitting_map_key { return Err ( EncoderError :: BadHashmapKey ) ; }
495
495
write ! ( self . writer, "null" ) ?;
496
496
Ok ( ( ) )
@@ -648,7 +648,7 @@ impl<'a> ::Encoder for Encoder<'a> {
648
648
}
649
649
fn emit_option_none ( & mut self ) -> EncodeResult {
650
650
if self . is_emitting_map_key { return Err ( EncoderError :: BadHashmapKey ) ; }
651
- self . emit_nil ( )
651
+ self . emit_unit ( )
652
652
}
653
653
fn emit_option_some < F > ( & mut self , f : F ) -> EncodeResult where
654
654
F : FnOnce ( & mut Encoder < ' a > ) -> EncodeResult ,
@@ -740,7 +740,7 @@ impl<'a> PrettyEncoder<'a> {
740
740
impl < ' a > :: Encoder for PrettyEncoder < ' a > {
741
741
type Error = EncoderError ;
742
742
743
- fn emit_nil ( & mut self ) -> EncodeResult {
743
+ fn emit_unit ( & mut self ) -> EncodeResult {
744
744
if self . is_emitting_map_key { return Err ( EncoderError :: BadHashmapKey ) ; }
745
745
write ! ( self . writer, "null" ) ?;
746
746
Ok ( ( ) )
@@ -923,7 +923,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> {
923
923
}
924
924
fn emit_option_none ( & mut self ) -> EncodeResult {
925
925
if self . is_emitting_map_key { return Err ( EncoderError :: BadHashmapKey ) ; }
926
- self . emit_nil ( )
926
+ self . emit_unit ( )
927
927
}
928
928
fn emit_option_some < F > ( & mut self , f : F ) -> EncodeResult where
929
929
F : FnOnce ( & mut PrettyEncoder < ' a > ) -> EncodeResult ,
@@ -1016,7 +1016,7 @@ impl Encodable for Json {
1016
1016
Json :: Boolean ( v) => v. encode ( e) ,
1017
1017
Json :: Array ( ref v) => v. encode ( e) ,
1018
1018
Json :: Object ( ref v) => v. encode ( e) ,
1019
- Json :: Null => e. emit_nil ( ) ,
1019
+ Json :: Null => e. emit_unit ( ) ,
1020
1020
}
1021
1021
}
1022
1022
}
0 commit comments