mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-14 04:41:01 +00:00
Format with rustfmt 0.8.2
This commit is contained in:
+35
-5
@@ -1602,7 +1602,13 @@ forwarded_impl!((T), Box<[T]>, Vec::into_boxed_slice);
|
|||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
forwarded_impl!((), Box<str>, String::into_boxed_str);
|
forwarded_impl!((), Box<str>, String::into_boxed_str);
|
||||||
|
|
||||||
#[cfg(all(not(de_rc_dst), feature = "rc", any(feature = "std", feature = "alloc")))]
|
#[cfg(
|
||||||
|
all(
|
||||||
|
not(de_rc_dst),
|
||||||
|
feature = "rc",
|
||||||
|
any(feature = "std", feature = "alloc")
|
||||||
|
)
|
||||||
|
)]
|
||||||
forwarded_impl! {
|
forwarded_impl! {
|
||||||
/// This impl requires the [`"rc"`] Cargo feature of Serde.
|
/// This impl requires the [`"rc"`] Cargo feature of Serde.
|
||||||
///
|
///
|
||||||
@@ -1614,7 +1620,13 @@ forwarded_impl! {
|
|||||||
(T), Arc<T>, Arc::new
|
(T), Arc<T>, Arc::new
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(not(de_rc_dst), feature = "rc", any(feature = "std", feature = "alloc")))]
|
#[cfg(
|
||||||
|
all(
|
||||||
|
not(de_rc_dst),
|
||||||
|
feature = "rc",
|
||||||
|
any(feature = "std", feature = "alloc")
|
||||||
|
)
|
||||||
|
)]
|
||||||
forwarded_impl! {
|
forwarded_impl! {
|
||||||
/// This impl requires the [`"rc"`] Cargo feature of Serde.
|
/// This impl requires the [`"rc"`] Cargo feature of Serde.
|
||||||
///
|
///
|
||||||
@@ -1681,7 +1693,13 @@ where
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
|
#[cfg(
|
||||||
|
all(
|
||||||
|
de_rc_dst,
|
||||||
|
feature = "rc",
|
||||||
|
any(feature = "std", feature = "alloc")
|
||||||
|
)
|
||||||
|
)]
|
||||||
macro_rules! box_forwarded_impl {
|
macro_rules! box_forwarded_impl {
|
||||||
(
|
(
|
||||||
$(#[doc = $doc:tt])*
|
$(#[doc = $doc:tt])*
|
||||||
@@ -1702,7 +1720,13 @@ macro_rules! box_forwarded_impl {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
|
#[cfg(
|
||||||
|
all(
|
||||||
|
de_rc_dst,
|
||||||
|
feature = "rc",
|
||||||
|
any(feature = "std", feature = "alloc")
|
||||||
|
)
|
||||||
|
)]
|
||||||
box_forwarded_impl! {
|
box_forwarded_impl! {
|
||||||
/// This impl requires the [`"rc"`] Cargo feature of Serde.
|
/// This impl requires the [`"rc"`] Cargo feature of Serde.
|
||||||
///
|
///
|
||||||
@@ -1714,7 +1738,13 @@ box_forwarded_impl! {
|
|||||||
Rc
|
Rc
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))]
|
#[cfg(
|
||||||
|
all(
|
||||||
|
de_rc_dst,
|
||||||
|
feature = "rc",
|
||||||
|
any(feature = "std", feature = "alloc")
|
||||||
|
)
|
||||||
|
)]
|
||||||
box_forwarded_impl! {
|
box_forwarded_impl! {
|
||||||
/// This impl requires the [`"rc"`] Cargo feature of Serde.
|
/// This impl requires the [`"rc"`] Cargo feature of Serde.
|
||||||
///
|
///
|
||||||
|
|||||||
+9
-2
@@ -96,8 +96,15 @@
|
|||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(
|
allow(
|
||||||
cast_lossless, const_static_lifetime, doc_markdown, linkedlist, needless_pass_by_value,
|
cast_lossless,
|
||||||
redundant_field_names, type_complexity, unreadable_literal, zero_prefixed_literal
|
const_static_lifetime,
|
||||||
|
doc_markdown,
|
||||||
|
linkedlist,
|
||||||
|
needless_pass_by_value,
|
||||||
|
redundant_field_names,
|
||||||
|
type_complexity,
|
||||||
|
unreadable_literal,
|
||||||
|
zero_prefixed_literal
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
// Whitelisted clippy_pedantic lints
|
// Whitelisted clippy_pedantic lints
|
||||||
|
|||||||
+17
-4
@@ -28,16 +28,29 @@
|
|||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(
|
allow(
|
||||||
enum_variant_names, redundant_field_names, too_many_arguments, used_underscore_binding,
|
enum_variant_names,
|
||||||
cyclomatic_complexity, needless_pass_by_value
|
redundant_field_names,
|
||||||
|
too_many_arguments,
|
||||||
|
used_underscore_binding,
|
||||||
|
cyclomatic_complexity,
|
||||||
|
needless_pass_by_value
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
// Whitelisted clippy_pedantic lints
|
// Whitelisted clippy_pedantic lints
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(
|
allow(
|
||||||
items_after_statements, doc_markdown, stutter, similar_names, use_self, single_match_else,
|
items_after_statements,
|
||||||
enum_glob_use, match_same_arms, filter_map, cast_possible_truncation, indexing_slicing,
|
doc_markdown,
|
||||||
|
stutter,
|
||||||
|
similar_names,
|
||||||
|
use_self,
|
||||||
|
single_match_else,
|
||||||
|
enum_glob_use,
|
||||||
|
match_same_arms,
|
||||||
|
filter_map,
|
||||||
|
cast_possible_truncation,
|
||||||
|
indexing_slicing,
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
// The `quote!` macro requires deep recursion.
|
// The `quote!` macro requires deep recursion.
|
||||||
|
|||||||
@@ -9,7 +9,12 @@
|
|||||||
#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.23.1")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive_internals/0.23.1")]
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(cyclomatic_complexity, doc_markdown, match_same_arms, redundant_field_names)
|
allow(
|
||||||
|
cyclomatic_complexity,
|
||||||
|
doc_markdown,
|
||||||
|
match_same_arms,
|
||||||
|
redundant_field_names
|
||||||
|
)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|||||||
@@ -253,7 +253,8 @@ impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
|
|||||||
Token::UnitVariant { name: n, .. }
|
Token::UnitVariant { name: n, .. }
|
||||||
| Token::NewtypeVariant { name: n, .. }
|
| Token::NewtypeVariant { name: n, .. }
|
||||||
| Token::TupleVariant { name: n, .. }
|
| Token::TupleVariant { name: n, .. }
|
||||||
| Token::StructVariant { name: n, .. } if name == n =>
|
| Token::StructVariant { name: n, .. }
|
||||||
|
if name == n =>
|
||||||
{
|
{
|
||||||
visitor.visit_enum(DeserializerEnumVisitor { de: self })
|
visitor.visit_enum(DeserializerEnumVisitor { de: self })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,8 +169,12 @@
|
|||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(
|
allow(
|
||||||
empty_line_after_outer_attr, missing_docs_in_private_items, redundant_field_names, stutter,
|
empty_line_after_outer_attr,
|
||||||
use_debug, use_self
|
missing_docs_in_private_items,
|
||||||
|
redundant_field_names,
|
||||||
|
stutter,
|
||||||
|
use_debug,
|
||||||
|
use_self
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
|||||||
@@ -348,7 +348,10 @@ struct ContainsNotDeserialize<A, B, C: DeserializeWith, E: MyDefault> {
|
|||||||
a: A,
|
a: A,
|
||||||
#[serde(skip_deserializing, default)]
|
#[serde(skip_deserializing, default)]
|
||||||
b: B,
|
b: B,
|
||||||
#[serde(deserialize_with = "DeserializeWith::deserialize_with", default)]
|
#[serde(
|
||||||
|
deserialize_with = "DeserializeWith::deserialize_with",
|
||||||
|
default
|
||||||
|
)]
|
||||||
c: C,
|
c: C,
|
||||||
#[serde(skip_deserializing, default = "MyDefault::my_default")]
|
#[serde(skip_deserializing, default = "MyDefault::my_default")]
|
||||||
e: E,
|
e: E,
|
||||||
|
|||||||
@@ -6,7 +6,10 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(decimal_literal_representation))]
|
#![cfg_attr(
|
||||||
|
feature = "cargo-clippy",
|
||||||
|
allow(decimal_literal_representation)
|
||||||
|
)]
|
||||||
#![cfg_attr(feature = "unstable", feature(never_type))]
|
#![cfg_attr(feature = "unstable", feature(never_type))]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|||||||
@@ -198,7 +198,12 @@ fn test_gen() {
|
|||||||
assert::<WithTraits1<X, X>>();
|
assert::<WithTraits1<X, X>>();
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
#[serde(bound(serialize = "D: SerializeWith", deserialize = "D: DeserializeWith"))]
|
#[serde(
|
||||||
|
bound(
|
||||||
|
serialize = "D: SerializeWith",
|
||||||
|
deserialize = "D: DeserializeWith"
|
||||||
|
)
|
||||||
|
)]
|
||||||
struct WithTraits2<D, E> {
|
struct WithTraits2<D, E> {
|
||||||
#[serde(
|
#[serde(
|
||||||
serialize_with = "SerializeWith::serialize_with",
|
serialize_with = "SerializeWith::serialize_with",
|
||||||
@@ -206,7 +211,8 @@ fn test_gen() {
|
|||||||
)]
|
)]
|
||||||
d: D,
|
d: D,
|
||||||
#[serde(
|
#[serde(
|
||||||
serialize_with = "SerializeWith::serialize_with", bound(serialize = "E: SerializeWith")
|
serialize_with = "SerializeWith::serialize_with",
|
||||||
|
bound(serialize = "E: SerializeWith")
|
||||||
)]
|
)]
|
||||||
#[serde(
|
#[serde(
|
||||||
deserialize_with = "DeserializeWith::deserialize_with",
|
deserialize_with = "DeserializeWith::deserialize_with",
|
||||||
@@ -234,7 +240,12 @@ fn test_gen() {
|
|||||||
assert::<VariantWithTraits1<X, X>>();
|
assert::<VariantWithTraits1<X, X>>();
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
#[serde(bound(serialize = "D: SerializeWith", deserialize = "D: DeserializeWith"))]
|
#[serde(
|
||||||
|
bound(
|
||||||
|
serialize = "D: SerializeWith",
|
||||||
|
deserialize = "D: DeserializeWith"
|
||||||
|
)
|
||||||
|
)]
|
||||||
enum VariantWithTraits2<D, E> {
|
enum VariantWithTraits2<D, E> {
|
||||||
#[serde(
|
#[serde(
|
||||||
serialize_with = "SerializeWith::serialize_with",
|
serialize_with = "SerializeWith::serialize_with",
|
||||||
@@ -242,7 +253,8 @@ fn test_gen() {
|
|||||||
)]
|
)]
|
||||||
D(D),
|
D(D),
|
||||||
#[serde(
|
#[serde(
|
||||||
serialize_with = "SerializeWith::serialize_with", bound(serialize = "E: SerializeWith")
|
serialize_with = "SerializeWith::serialize_with",
|
||||||
|
bound(serialize = "E: SerializeWith")
|
||||||
)]
|
)]
|
||||||
#[serde(
|
#[serde(
|
||||||
deserialize_with = "DeserializeWith::deserialize_with",
|
deserialize_with = "DeserializeWith::deserialize_with",
|
||||||
|
|||||||
Reference in New Issue
Block a user