mirror of
https://github.com/serde-rs/json.git
synced 2026-03-03 04:19:13 +00:00
Format with rustfmt 0.8.2
This commit is contained in:
parent
9316c31625
commit
75312089bd
12
src/de.rs
12
src/de.rs
@ -339,11 +339,13 @@ impl<'de, R: Read<'de>> Deserializer<R> {
|
||||
// number as a `u64` until we grow too large. At that point, switch to
|
||||
// parsing the value as a `f64`.
|
||||
if overflow!(res * 10 + digit, u64::max_value()) {
|
||||
return Ok(ParserNumber::F64(try!(self.parse_long_integer(
|
||||
positive,
|
||||
res,
|
||||
1, // res * 10^1
|
||||
))));
|
||||
return Ok(ParserNumber::F64(try!(
|
||||
self.parse_long_integer(
|
||||
positive,
|
||||
res,
|
||||
1, // res * 10^1
|
||||
)
|
||||
)));
|
||||
}
|
||||
|
||||
res = res * 10 + digit;
|
||||
|
||||
@ -146,11 +146,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<R> private::Sealed for IoRead<R>
|
||||
where
|
||||
R: io::Read,
|
||||
{
|
||||
}
|
||||
impl<R> private::Sealed for IoRead<R> where R: io::Read {}
|
||||
|
||||
impl<R> IoRead<R>
|
||||
where
|
||||
|
||||
@ -147,11 +147,7 @@ mod private {
|
||||
impl Sealed for usize {}
|
||||
impl Sealed for str {}
|
||||
impl Sealed for String {}
|
||||
impl<'a, T: ?Sized> Sealed for &'a T
|
||||
where
|
||||
T: Sealed,
|
||||
{
|
||||
}
|
||||
impl<'a, T: ?Sized> Sealed for &'a T where T: Sealed {}
|
||||
}
|
||||
|
||||
/// Used in panic messages.
|
||||
|
||||
@ -312,12 +312,7 @@ fn test_write_object() {
|
||||
),
|
||||
]);
|
||||
|
||||
test_encode_ok(&[
|
||||
(
|
||||
treemap!['c' => ()],
|
||||
"{\"c\":null}",
|
||||
),
|
||||
]);
|
||||
test_encode_ok(&[(treemap!['c' => ()], "{\"c\":null}")]);
|
||||
|
||||
test_pretty_encode_ok(&[
|
||||
(
|
||||
@ -1106,10 +1101,7 @@ fn test_parse_object() {
|
||||
),
|
||||
)]);
|
||||
|
||||
test_parse_ok(vec![(
|
||||
"{\"c\":null}",
|
||||
treemap!('c' => ()),
|
||||
)]);
|
||||
test_parse_ok(vec![("{\"c\":null}", treemap!('c' => ()))]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user