mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-05-08 05:27:58 +00:00
Format in rfc style
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user