mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-28 03:27:56 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 69dd3215f4 | |||
| a7a7a31809 | |||
| af9996aa9a | |||
| 0d4d47c398 | |||
| 30361ac6d0 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.28" # remember to update html_root_url
|
version = "1.0.30" # remember to update html_root_url
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "A generic serialization/deserialization framework"
|
description = "A generic serialization/deserialization framework"
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Serde types in rustdoc of other crates get linked to here.
|
// Serde types in rustdoc of other crates get linked to here.
|
||||||
#![doc(html_root_url = "https://docs.rs/serde/1.0.28")]
|
#![doc(html_root_url = "https://docs.rs/serde/1.0.30")]
|
||||||
// Support using Serde without the standard library!
|
// Support using Serde without the standard library!
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
// Unstable functionality only if the user asks for it. For tracking and
|
// Unstable functionality only if the user asks for it. For tracking and
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deserializer.deserialize_str(CowBytesVisitor)
|
deserializer.deserialize_bytes(CowBytesVisitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod size_hint {
|
pub mod size_hint {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.28" # remember to update html_root_url
|
version = "1.0.30" # remember to update html_root_url
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
||||||
|
|||||||
+5
-11
@@ -566,16 +566,14 @@ fn deserialize_seq(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// FIXME: parentheses around field values are because of
|
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
|
||||||
let mut result = if is_struct {
|
let mut result = if is_struct {
|
||||||
let names = fields.iter().map(|f| &f.ident);
|
let names = fields.iter().map(|f| &f.ident);
|
||||||
quote_spanned! {Span::call_site()=>
|
quote_spanned! {Span::call_site()=>
|
||||||
#type_path { #( #names: (#vars) ),* }
|
#type_path { #( #names: #vars ),* }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
quote_spanned! {Span::call_site()=>
|
quote_spanned! {Span::call_site()=>
|
||||||
#type_path ( #((#vars)),* )
|
#type_path ( #(#vars),* )
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -718,9 +716,7 @@ fn deserialize_newtype_struct(type_path: &Tokens, params: &Parameters, field: &F
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: parentheses around field values are because of
|
let mut result = quote_spanned!(Span::call_site()=> #type_path(#value));
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
|
||||||
let mut result = quote_spanned!(Span::call_site()=> #type_path((#value)));
|
|
||||||
if params.has_getter {
|
if params.has_getter {
|
||||||
let this = ¶ms.this;
|
let this = ¶ms.this;
|
||||||
result = quote! {
|
result = quote! {
|
||||||
@@ -2054,15 +2050,13 @@ fn deserialize_map(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// FIXME: parentheses around field values are because of
|
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
|
||||||
let result = fields_names.iter().map(|&(field, ref name)| {
|
let result = fields_names.iter().map(|&(field, ref name)| {
|
||||||
let ident = field.ident.expect("struct contains unnamed fields");
|
let ident = field.ident.expect("struct contains unnamed fields");
|
||||||
if field.attrs.skip_deserializing() {
|
if field.attrs.skip_deserializing() {
|
||||||
let value = Expr(expr_is_missing(field, cattrs));
|
let value = Expr(expr_is_missing(field, cattrs));
|
||||||
quote_spanned!(Span::call_site()=> #ident: (#value))
|
quote_spanned!(Span::call_site()=> #ident: #value)
|
||||||
} else {
|
} else {
|
||||||
quote_spanned!(Span::call_site()=> #ident: (#name))
|
quote_spanned!(Span::call_site()=> #ident: #name)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
//!
|
//!
|
||||||
//! [https://serde.rs/derive.html]: https://serde.rs/derive.html
|
//! [https://serde.rs/derive.html]: https://serde.rs/derive.html
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.28")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.30")]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(enum_variant_names, redundant_field_names,
|
#![cfg_attr(feature = "cargo-clippy", allow(enum_variant_names, redundant_field_names,
|
||||||
too_many_arguments, used_underscore_binding))]
|
too_many_arguments, used_underscore_binding))]
|
||||||
// The `quote!` macro requires deep recursion.
|
// The `quote!` macro requires deep recursion.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_test"
|
name = "serde_test"
|
||||||
version = "1.0.28" # remember to update html_root_url
|
version = "1.0.30" # remember to update html_root_url
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Token De/Serializer for testing De/Serialize implementations"
|
description = "Token De/Serializer for testing De/Serialize implementations"
|
||||||
|
|||||||
@@ -155,7 +155,7 @@
|
|||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.28")]
|
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.30")]
|
||||||
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
||||||
// Whitelisted clippy lints
|
// Whitelisted clippy lints
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp))]
|
#![cfg_attr(feature = "cargo-clippy", allow(float_cmp))]
|
||||||
|
|||||||
@@ -9,10 +9,6 @@
|
|||||||
#![feature(lang_items, start, compiler_builtins_lib)]
|
#![feature(lang_items, start, compiler_builtins_lib)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
|
||||||
#![allow(unused_parens)]
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(double_parens))]
|
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
extern crate compiler_builtins;
|
extern crate compiler_builtins;
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,6 @@
|
|||||||
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))]
|
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))]
|
||||||
|
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
|
||||||
#![allow(unused_parens)]
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(double_parens))]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
#![cfg_attr(feature = "cargo-clippy", allow(decimal_literal_representation))]
|
||||||
#![allow(unused_parens)]
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(decimal_literal_representation, double_parens))]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
#![deny(warnings)]
|
#![deny(warnings)]
|
||||||
#![cfg_attr(feature = "unstable", feature(non_ascii_idents))]
|
#![cfg_attr(feature = "unstable", feature(non_ascii_idents))]
|
||||||
|
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
|
||||||
#![allow(unused_parens)]
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(double_parens))]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
|
|
||||||
#![deny(trivial_numeric_casts)]
|
#![deny(trivial_numeric_casts)]
|
||||||
|
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
#![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names))]
|
||||||
#![allow(unused_parens)]
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(double_parens, redundant_field_names))]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|||||||
@@ -6,9 +6,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
// https://github.com/rust-lang/rust/issues/47311
|
#![cfg_attr(feature = "cargo-clippy", allow(redundant_field_names))]
|
||||||
#![allow(unused_parens)]
|
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(double_parens, redundant_field_names))]
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serde_derive;
|
extern crate serde_derive;
|
||||||
|
|||||||
Reference in New Issue
Block a user