@@ -490,7 +490,7 @@ macro_rules! emit_enquoted_if_mapkey {
490490impl < ' a > :: Encoder for Encoder < ' a > {
491491 type Error = EncoderError ;
492492
493- fn emit_nil ( & mut self ) -> EncodeResult {
493+ fn emit_unit ( & mut self ) -> EncodeResult {
494494 if self . is_emitting_map_key { return Err ( EncoderError :: BadHashmapKey ) ; }
495495 write ! ( self . writer, "null" ) ?;
496496 Ok ( ( ) )
@@ -648,7 +648,7 @@ impl<'a> ::Encoder for Encoder<'a> {
648648 }
649649 fn emit_option_none ( & mut self ) -> EncodeResult {
650650 if self . is_emitting_map_key { return Err ( EncoderError :: BadHashmapKey ) ; }
651- self . emit_nil ( )
651+ self . emit_unit ( )
652652 }
653653 fn emit_option_some < F > ( & mut self , f : F ) -> EncodeResult where
654654 F : FnOnce ( & mut Encoder < ' a > ) -> EncodeResult ,
@@ -740,7 +740,7 @@ impl<'a> PrettyEncoder<'a> {
740740impl < ' a > :: Encoder for PrettyEncoder < ' a > {
741741 type Error = EncoderError ;
742742
743- fn emit_nil ( & mut self ) -> EncodeResult {
743+ fn emit_unit ( & mut self ) -> EncodeResult {
744744 if self . is_emitting_map_key { return Err ( EncoderError :: BadHashmapKey ) ; }
745745 write ! ( self . writer, "null" ) ?;
746746 Ok ( ( ) )
@@ -923,7 +923,7 @@ impl<'a> ::Encoder for PrettyEncoder<'a> {
923923 }
924924 fn emit_option_none ( & mut self ) -> EncodeResult {
925925 if self . is_emitting_map_key { return Err ( EncoderError :: BadHashmapKey ) ; }
926- self . emit_nil ( )
926+ self . emit_unit ( )
927927 }
928928 fn emit_option_some < F > ( & mut self , f : F ) -> EncodeResult where
929929 F : FnOnce ( & mut PrettyEncoder < ' a > ) -> EncodeResult ,
@@ -1016,7 +1016,7 @@ impl Encodable for Json {
10161016 Json :: Boolean ( v) => v. encode ( e) ,
10171017 Json :: Array ( ref v) => v. encode ( e) ,
10181018 Json :: Object ( ref v) => v. encode ( e) ,
1019- Json :: Null => e. emit_nil ( ) ,
1019+ Json :: Null => e. emit_unit ( ) ,
10201020 }
10211021 }
10221022}
0 commit comments