From d10fa2bd8667bf64d0cf8e894f2961a3c59b6368 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 14 Apr 2017 14:38:58 -0700 Subject: [PATCH] Keep underscored names out of the documentation --- serde/src/de/value.rs | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/serde/src/de/value.rs b/serde/src/de/value.rs index 20ff3907..06e50414 100644 --- a/serde/src/de/value.rs +++ b/serde/src/de/value.rs @@ -65,10 +65,11 @@ impl de::Error for Error { } #[cfg(not(any(feature = "std", feature = "collections")))] - fn custom(_msg: T) -> Self + fn custom(msg: T) -> Self where T: Display, { + let _ = msg; Error { err: () } } } @@ -241,13 +242,15 @@ where fn deserialize_enum( self, - _name: &str, - _variants: &'static [&'static str], + name: &str, + variants: &'static [&'static str], visitor: V, ) -> Result where V: de::Visitor<'de>, { + let _ = name; + let _ = variants; visitor.visit_enum(self) } } @@ -305,13 +308,15 @@ where fn deserialize_enum( self, - _name: &str, - _variants: &'static [&'static str], + name: &str, + variants: &'static [&'static str], visitor: V, ) -> Result where V: de::Visitor<'de>, { + let _ = name; + let _ = variants; visitor.visit_enum(self) } @@ -378,13 +383,15 @@ where fn deserialize_enum( self, - _name: &str, - _variants: &'static [&'static str], + name: &str, + variants: &'static [&'static str], visitor: V, ) -> Result where V: de::Visitor<'de>, { + let _ = name; + let _ = variants; visitor.visit_enum(self) } @@ -455,13 +462,15 @@ where fn deserialize_enum( self, - _name: &str, - _variants: &'static [&'static str], + name: &str, + variants: &'static [&'static str], visitor: V, ) -> Result where V: de::Visitor<'de>, { + let _ = name; + let _ = variants; visitor.visit_enum(self) } @@ -761,12 +770,13 @@ where fn deserialize_seq_fixed_size( self, - _len: usize, + len: usize, visitor: V, ) -> Result where V: de::Visitor<'de>, { + let _ = len; self.deserialize_seq(visitor) }