mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-16 22:51:01 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5fa711d75d | |||
| f5d8ae423a | |||
| 1d54973b92 | |||
| b8fafefd85 | |||
| c42ebb8839 | |||
| 9e680620b5 | |||
| 846f865de2 |
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.196"
|
version = "1.0.197"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
categories = ["encoding", "no-std", "no-std::no-alloc"]
|
categories = ["encoding", "no-std", "no-std::no-alloc"]
|
||||||
@@ -37,7 +37,7 @@ rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
|
|||||||
# is compatible with exactly one serde release because the generated code
|
# is compatible with exactly one serde release because the generated code
|
||||||
# involves nonpublic APIs which are not bound by semver.
|
# involves nonpublic APIs which are not bound by semver.
|
||||||
[target.'cfg(any())'.dependencies]
|
[target.'cfg(any())'.dependencies]
|
||||||
serde_derive = { version = "=1.0.196", path = "../serde_derive" }
|
serde_derive = { version = "=1.0.197", path = "../serde_derive" }
|
||||||
|
|
||||||
|
|
||||||
### FEATURES #################################################################
|
### FEATURES #################################################################
|
||||||
|
|||||||
+13
-13
@@ -405,17 +405,17 @@ impl<'a> fmt::Display for Unexpected<'a> {
|
|||||||
Float(f) => write!(formatter, "floating point `{}`", WithDecimalPoint(f)),
|
Float(f) => write!(formatter, "floating point `{}`", WithDecimalPoint(f)),
|
||||||
Char(c) => write!(formatter, "character `{}`", c),
|
Char(c) => write!(formatter, "character `{}`", c),
|
||||||
Str(s) => write!(formatter, "string {:?}", s),
|
Str(s) => write!(formatter, "string {:?}", s),
|
||||||
Bytes(_) => write!(formatter, "byte array"),
|
Bytes(_) => formatter.write_str("byte array"),
|
||||||
Unit => write!(formatter, "unit value"),
|
Unit => formatter.write_str("unit value"),
|
||||||
Option => write!(formatter, "Option value"),
|
Option => formatter.write_str("Option value"),
|
||||||
NewtypeStruct => write!(formatter, "newtype struct"),
|
NewtypeStruct => formatter.write_str("newtype struct"),
|
||||||
Seq => write!(formatter, "sequence"),
|
Seq => formatter.write_str("sequence"),
|
||||||
Map => write!(formatter, "map"),
|
Map => formatter.write_str("map"),
|
||||||
Enum => write!(formatter, "enum"),
|
Enum => formatter.write_str("enum"),
|
||||||
UnitVariant => write!(formatter, "unit variant"),
|
UnitVariant => formatter.write_str("unit variant"),
|
||||||
NewtypeVariant => write!(formatter, "newtype variant"),
|
NewtypeVariant => formatter.write_str("newtype variant"),
|
||||||
TupleVariant => write!(formatter, "tuple variant"),
|
TupleVariant => formatter.write_str("tuple variant"),
|
||||||
StructVariant => write!(formatter, "struct variant"),
|
StructVariant => formatter.write_str("struct variant"),
|
||||||
Other(other) => formatter.write_str(other),
|
Other(other) => formatter.write_str(other),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2278,10 +2278,10 @@ impl Display for OneOf {
|
|||||||
1 => write!(formatter, "`{}`", self.names[0]),
|
1 => write!(formatter, "`{}`", self.names[0]),
|
||||||
2 => write!(formatter, "`{}` or `{}`", self.names[0], self.names[1]),
|
2 => write!(formatter, "`{}` or `{}`", self.names[0], self.names[1]),
|
||||||
_ => {
|
_ => {
|
||||||
tri!(write!(formatter, "one of "));
|
tri!(formatter.write_str("one of "));
|
||||||
for (i, alt) in self.names.iter().enumerate() {
|
for (i, alt) in self.names.iter().enumerate() {
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
tri!(write!(formatter, ", "));
|
tri!(formatter.write_str(", "));
|
||||||
}
|
}
|
||||||
tri!(write!(formatter, "`{}`", alt));
|
tri!(write!(formatter, "`{}`", alt));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -983,7 +983,7 @@ struct ExpectedInSeq(usize);
|
|||||||
impl Expected for ExpectedInSeq {
|
impl Expected for ExpectedInSeq {
|
||||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
if self.0 == 1 {
|
if self.0 == 1 {
|
||||||
write!(formatter, "1 element in sequence")
|
formatter.write_str("1 element in sequence")
|
||||||
} else {
|
} else {
|
||||||
write!(formatter, "{} elements in sequence", self.0)
|
write!(formatter, "{} elements in sequence", self.0)
|
||||||
}
|
}
|
||||||
@@ -1411,7 +1411,7 @@ struct ExpectedInMap(usize);
|
|||||||
impl Expected for ExpectedInMap {
|
impl Expected for ExpectedInMap {
|
||||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
if self.0 == 1 {
|
if self.0 == 1 {
|
||||||
write!(formatter, "1 element in map")
|
formatter.write_str("1 element in map")
|
||||||
} else {
|
} else {
|
||||||
write!(formatter, "{} elements in map", self.0)
|
write!(formatter, "{} elements in map", self.0)
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-6
@@ -95,7 +95,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.196")]
|
#![doc(html_root_url = "https://docs.rs/serde/1.0.197")]
|
||||||
// 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)]
|
||||||
// Show which crate feature enables conditionally compiled APIs in documentation.
|
// Show which crate feature enables conditionally compiled APIs in documentation.
|
||||||
@@ -130,6 +130,7 @@
|
|||||||
clippy::derive_partial_eq_without_eq,
|
clippy::derive_partial_eq_without_eq,
|
||||||
clippy::enum_glob_use,
|
clippy::enum_glob_use,
|
||||||
clippy::explicit_auto_deref,
|
clippy::explicit_auto_deref,
|
||||||
|
clippy::incompatible_msrv,
|
||||||
clippy::let_underscore_untyped,
|
clippy::let_underscore_untyped,
|
||||||
clippy::map_err_ignore,
|
clippy::map_err_ignore,
|
||||||
clippy::new_without_default,
|
clippy::new_without_default,
|
||||||
@@ -178,16 +179,16 @@ mod lib {
|
|||||||
pub use self::core::{cmp, mem, slice};
|
pub use self::core::{cmp, mem, slice};
|
||||||
|
|
||||||
pub use self::core::cell::{Cell, RefCell};
|
pub use self::core::cell::{Cell, RefCell};
|
||||||
pub use self::core::clone::{self, Clone};
|
pub use self::core::clone;
|
||||||
pub use self::core::cmp::Reverse;
|
pub use self::core::cmp::Reverse;
|
||||||
pub use self::core::convert::{self, From, Into};
|
pub use self::core::convert;
|
||||||
pub use self::core::default::{self, Default};
|
pub use self::core::default;
|
||||||
pub use self::core::fmt::{self, Debug, Display, Write as FmtWrite};
|
pub use self::core::fmt::{self, Debug, Display, Write as FmtWrite};
|
||||||
pub use self::core::marker::{self, PhantomData};
|
pub use self::core::marker::{self, PhantomData};
|
||||||
pub use self::core::num::Wrapping;
|
pub use self::core::num::Wrapping;
|
||||||
pub use self::core::ops::{Bound, Range, RangeFrom, RangeInclusive, RangeTo};
|
pub use self::core::ops::{Bound, Range, RangeFrom, RangeInclusive, RangeTo};
|
||||||
pub use self::core::option::{self, Option};
|
pub use self::core::option;
|
||||||
pub use self::core::result::{self, Result};
|
pub use self::core::result;
|
||||||
pub use self::core::time::Duration;
|
pub use self::core::time::Duration;
|
||||||
|
|
||||||
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.196"
|
version = "1.0.197"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
categories = ["no-std", "no-std::no-alloc"]
|
categories = ["no-std", "no-std::no-alloc"]
|
||||||
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
||||||
|
|||||||
@@ -13,7 +13,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.196")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.197")]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
#![allow(
|
#![allow(
|
||||||
// clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054
|
// clippy false positive: https://github.com/rust-lang/rust-clippy/issues/7054
|
||||||
|
|||||||
@@ -27,19 +27,21 @@ mod fake_serde {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub trait Serialize {
|
pub trait Serialize {
|
||||||
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>;
|
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub trait Deserialize<'a>: Sized {
|
pub trait Deserialize<'a>: Sized {
|
||||||
fn deserialize<D: Deserializer<'a>>(deserializer: D) -> Result<Self, D::Error>;
|
fn deserialize<D: Deserializer<'a>>(deserializer: D) -> Result<Self, D::Error>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trait AssertNotSerdeSerialize {}
|
pub trait AssertNotSerdeSerialize {}
|
||||||
|
|
||||||
impl<T: serde::Serialize> AssertNotSerdeSerialize for T {}
|
impl<T: serde::Serialize> AssertNotSerdeSerialize for T {}
|
||||||
|
|
||||||
trait AssertNotSerdeDeserialize<'a> {}
|
pub trait AssertNotSerdeDeserialize<'a> {}
|
||||||
|
|
||||||
impl<'a, T: serde::Deserialize<'a>> AssertNotSerdeDeserialize<'a> for T {}
|
impl<'a, T: serde::Deserialize<'a>> AssertNotSerdeDeserialize<'a> for T {}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ fn test_map_access_to_enum() {
|
|||||||
type Value = Potential;
|
type Value = Potential;
|
||||||
|
|
||||||
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(formatter, "a map")
|
formatter.write_str("a map")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_map<A>(self, map: A) -> Result<Self::Value, A::Error>
|
fn visit_map<A>(self, map: A) -> Result<Self::Value, A::Error>
|
||||||
|
|||||||
@@ -12,7 +12,3 @@ note: tuple struct defined here
|
|||||||
4 | pub struct S(pub u16);
|
4 | pub struct S(pub u16);
|
||||||
| ^
|
| ^
|
||||||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
help: you can convert a `u8` to a `u16`
|
|
||||||
|
|
|
||||||
7 | #[derive(Deserialize.into())]
|
|
||||||
| +++++++
|
|
||||||
|
|||||||
Reference in New Issue
Block a user