mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-24 04:07:59 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e797431268 | |||
| 4a335f8933 | |||
| 84721920fd | |||
| 192c7819ee | |||
| ede40bdfaa | |||
| e3d871ff7b | |||
| 0e1c4093c8 | |||
| 0d5b6c180c | |||
| 8084258a3e |
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde"
|
||||
version = "1.0.117" # remember to update html_root_url and serde_derive dependency
|
||||
version = "1.0.118" # remember to update html_root_url and serde_derive dependency
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "A generic serialization/deserialization framework"
|
||||
@@ -14,7 +14,7 @@ include = ["build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APAC
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
serde_derive = { version = "=1.0.117", optional = true, path = "../serde_derive" }
|
||||
serde_derive = { version = "=1.0.118", optional = true, path = "../serde_derive" }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_derive = { version = "1.0", path = "../serde_derive" }
|
||||
|
||||
+4
-11
@@ -1871,7 +1871,7 @@ impl<'de> Deserialize<'de> for Duration {
|
||||
enum Field {
|
||||
Secs,
|
||||
Nanos,
|
||||
};
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for Field {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
@@ -1996,7 +1996,7 @@ impl<'de> Deserialize<'de> for SystemTime {
|
||||
enum Field {
|
||||
Secs,
|
||||
Nanos,
|
||||
};
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for Field {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
@@ -2334,10 +2334,7 @@ where
|
||||
0 => Ok(Field::Unbounded),
|
||||
1 => Ok(Field::Included),
|
||||
2 => Ok(Field::Excluded),
|
||||
_ => Err(Error::invalid_value(
|
||||
Unexpected::Unsigned(value),
|
||||
&self,
|
||||
)),
|
||||
_ => Err(Error::invalid_value(Unexpected::Unsigned(value), &self)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2499,10 +2496,7 @@ where
|
||||
match value {
|
||||
0 => Ok(Field::Ok),
|
||||
1 => Ok(Field::Err),
|
||||
_ => Err(Error::invalid_value(
|
||||
Unexpected::Unsigned(value),
|
||||
&self,
|
||||
)),
|
||||
_ => Err(Error::invalid_value(Unexpected::Unsigned(value), &self)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2570,7 +2564,6 @@ where
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<'de, T> Deserialize<'de> for Wrapping<T>
|
||||
where
|
||||
T: Deserialize<'de>,
|
||||
|
||||
+3
-3
@@ -82,7 +82,7 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Serde types in rustdoc of other crates get linked to here.
|
||||
#![doc(html_root_url = "https://docs.rs/serde/1.0.117")]
|
||||
#![doc(html_root_url = "https://docs.rs/serde/1.0.118")]
|
||||
// Support using Serde without the standard library!
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
// Unstable functionality only if the user asks for it. For tracking and
|
||||
@@ -119,6 +119,7 @@
|
||||
// correctly used
|
||||
enum_glob_use,
|
||||
map_err_ignore,
|
||||
result_unit_err,
|
||||
wildcard_imports,
|
||||
// not practical
|
||||
needless_pass_by_value,
|
||||
@@ -165,6 +166,7 @@ mod lib {
|
||||
pub use self::core::default::{self, Default};
|
||||
pub use self::core::fmt::{self, Debug, Display};
|
||||
pub use self::core::marker::{self, PhantomData};
|
||||
pub use self::core::num::Wrapping;
|
||||
pub use self::core::ops::Range;
|
||||
pub use self::core::option::{self, Option};
|
||||
pub use self::core::result::{self, Result};
|
||||
@@ -216,8 +218,6 @@ mod lib {
|
||||
#[cfg(feature = "std")]
|
||||
pub use std::io::Write;
|
||||
#[cfg(feature = "std")]
|
||||
pub use std::num::Wrapping;
|
||||
#[cfg(feature = "std")]
|
||||
pub use std::path::{Path, PathBuf};
|
||||
#[cfg(feature = "std")]
|
||||
pub use std::sync::{Mutex, RwLock};
|
||||
|
||||
@@ -824,7 +824,6 @@ impl Serialize for OsString {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<T> Serialize for Wrapping<T>
|
||||
where
|
||||
T: Serialize,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde_derive"
|
||||
version = "1.0.117" # remember to update html_root_url
|
||||
version = "1.0.118" # remember to update html_root_url
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
||||
|
||||
@@ -12,6 +12,7 @@ use internals::{attr, ungroup, Ctxt, Derive};
|
||||
use pretend;
|
||||
|
||||
use std::collections::BTreeSet;
|
||||
use std::ptr;
|
||||
|
||||
pub fn expand_derive_deserialize(input: &syn::DeriveInput) -> Result<TokenStream, Vec<syn::Error>> {
|
||||
let ctxt = Ctxt::new();
|
||||
@@ -359,7 +360,7 @@ fn deserialize_transparent(cont: &Container, params: &Parameters) -> Fragment {
|
||||
|
||||
let assign = fields.iter().map(|field| {
|
||||
let member = &field.member;
|
||||
if field as *const Field == transparent_field as *const Field {
|
||||
if ptr::eq(field, transparent_field) {
|
||||
quote!(#member: __transparent)
|
||||
} else {
|
||||
let value = match field.attrs.default() {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
//!
|
||||
//! [https://serde.rs/derive.html]: https://serde.rs/derive.html
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.117")]
|
||||
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.118")]
|
||||
#![allow(unknown_lints, bare_trait_objects)]
|
||||
#![deny(clippy::all, clippy::pedantic)]
|
||||
// Ignored clippy lints
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
allow(
|
||||
cognitive_complexity,
|
||||
redundant_field_names,
|
||||
result_unit_err,
|
||||
trivially_copy_pass_by_ref,
|
||||
wildcard_in_or_patterns,
|
||||
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "serde_test"
|
||||
version = "1.0.117" # remember to update html_root_url
|
||||
version = "1.0.118" # remember to update html_root_url
|
||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "Token De/Serializer for testing De/Serialize implementations"
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
//! # }
|
||||
//! ```
|
||||
|
||||
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.117")]
|
||||
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.118")]
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
||||
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
||||
// Ignored clippy lints
|
||||
|
||||
@@ -23,4 +23,4 @@ rustversion = "1.0"
|
||||
serde = { path = "../serde", features = ["rc", "derive"] }
|
||||
serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] }
|
||||
serde_test = { path = "../serde_test" }
|
||||
trybuild = "1.0"
|
||||
trybuild = { version = "1.0.19", features = ["diff"] }
|
||||
|
||||
@@ -5,6 +5,6 @@ error[E0308]: mismatched types
|
||||
| ^^^^^^^^^^^
|
||||
| |
|
||||
| expected `u16`, found `u8`
|
||||
| help: you can convert an `u8` to `u16`: `Deserialize.into()`
|
||||
| help: you can convert a `u8` to a `u16`: `Deserialize.into()`
|
||||
|
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
Reference in New Issue
Block a user