Format in rfc style

This commit is contained in:
David Tolnay
2017-04-18 14:23:21 -07:00
parent c567e749ef
commit 7a7d4c6364
12 changed files with 180 additions and 149 deletions
+3 -2
View File
@@ -1039,7 +1039,8 @@ impl<'de> Visitor<'de> for OsStringVisitor {
match try!(data.variant()) {
(OsStringKind::Windows, v) => {
v.newtype_variant::<Vec<u16>>().map(|vec| OsString::from_wide(&vec))
v.newtype_variant::<Vec<u16>>()
.map(|vec| OsString::from_wide(&vec))
}
(OsStringKind::Unix, _) => Err(Error::custom("cannot deserialize Unix OS string on Windows",),),
}
@@ -1151,7 +1152,7 @@ where
impl<'de, T> Deserialize<'de> for RefCell<T>
where
T: Deserialize<'de>
T: Deserialize<'de>,
{
fn deserialize<D>(deserializer: D) -> Result<RefCell<T>, D::Error>
where
+2 -1
View File
@@ -922,7 +922,8 @@ where
Second<I::Item>: Debug,
{
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.debug_struct("MapDeserializer")
formatter
.debug_struct("MapDeserializer")
.field("iter", &self.iter)
.field("value", &self.value)
.field("count", &self.count)
+4 -8
View File
@@ -191,7 +191,8 @@ pub mod size_hint {
use lib::*;
pub fn from_bounds<I>(iter: &I) -> Option<usize>
where I: Iterator
where
I: Iterator,
{
helper(iter.size_hint())
}
@@ -202,9 +203,7 @@ pub mod size_hint {
fn helper(bounds: (usize, Option<usize>)) -> Option<usize> {
match bounds {
(lower, Some(upper)) if lower == upper => {
Some(upper)
}
(lower, Some(upper)) if lower == upper => Some(upper),
_ => None,
}
}
@@ -1026,10 +1025,7 @@ mod content {
type Error = E;
type Variant = VariantDeserializer<Self::Error>;
fn variant_seed<V>(
self,
seed: V,
) -> Result<(V::Value, VariantDeserializer<E>), Self::Error>
fn variant_seed<V>(self, seed: V) -> Result<(V::Value, Self::Variant), E>
where
V: de::DeserializeSeed<'de>,
{