Skip to content

Commit

Permalink
Merge pull request #7 from serde-rs/master
Browse files Browse the repository at this point in the history
Fork Sync: Update from parent repository
  • Loading branch information
github-actions[bot] authored Oct 29, 2024
2 parents 9c9cdd1 + 4180621 commit 5114bbb
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 5 deletions.
4 changes: 2 additions & 2 deletions serde/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde"
version = "1.0.213"
version = "1.0.214"
authors = ["Erick Tryzelaar <[email protected]>", "David Tolnay <[email protected]>"]
build = "build.rs"
categories = ["encoding", "no-std", "no-std::no-alloc"]
Expand Down Expand Up @@ -37,7 +37,7 @@ rustdoc-args = ["--generate-link-to-definition"]
# is compatible with exactly one serde release because the generated code
# involves nonpublic APIs which are not bound by semver.
[target.'cfg(any())'.dependencies]
serde_derive = { version = "=1.0.213", path = "../serde_derive" }
serde_derive = { version = "=1.0.214", path = "../serde_derive" }


### FEATURES #################################################################
Expand Down
174 changes: 174 additions & 0 deletions serde/src/de/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@ where
}
}

impl<'de, E> IntoDeserializer<'de, E> for UnitDeserializer<E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<E> Debug for UnitDeserializer<E> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.debug_struct("UnitDeserializer").finish()
Expand Down Expand Up @@ -225,6 +236,18 @@ where
}
}

#[cfg(feature = "unstable")]
impl<'de, E> IntoDeserializer<'de, E> for NeverDeserializer<E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

////////////////////////////////////////////////////////////////////////////////

macro_rules! primitive_deserializer {
Expand Down Expand Up @@ -279,6 +302,17 @@ macro_rules! primitive_deserializer {
}
}

impl<'de, E> IntoDeserializer<'de, E> for $name<E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<E> Debug for $name<E> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter
Expand Down Expand Up @@ -369,6 +403,17 @@ where
}
}

impl<'de, E> IntoDeserializer<'de, E> for U32Deserializer<E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<'de, E> de::EnumAccess<'de> for U32Deserializer<E>
where
E: de::Error,
Expand Down Expand Up @@ -458,6 +503,17 @@ where
}
}

impl<'de, 'a, E> IntoDeserializer<'de, E> for StrDeserializer<'a, E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<'de, 'a, E> de::EnumAccess<'de> for StrDeserializer<'a, E>
where
E: de::Error,
Expand Down Expand Up @@ -537,6 +593,17 @@ where
}
}

impl<'de, E> IntoDeserializer<'de, E> for BorrowedStrDeserializer<'de, E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<'de, E> de::EnumAccess<'de> for BorrowedStrDeserializer<'de, E>
where
E: de::Error,
Expand Down Expand Up @@ -640,6 +707,18 @@ where
}
}

#[cfg(any(feature = "std", feature = "alloc"))]
impl<'de, E> IntoDeserializer<'de, E> for StringDeserializer<E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

#[cfg(any(feature = "std", feature = "alloc"))]
impl<'de, E> de::EnumAccess<'de> for StringDeserializer<E>
where
Expand Down Expand Up @@ -748,6 +827,18 @@ where
}
}

#[cfg(any(feature = "std", feature = "alloc"))]
impl<'de, 'a, E> IntoDeserializer<'de, E> for CowStrDeserializer<'a, E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

#[cfg(any(feature = "std", feature = "alloc"))]
impl<'de, 'a, E> de::EnumAccess<'de> for CowStrDeserializer<'a, E>
where
Expand Down Expand Up @@ -825,6 +916,17 @@ where
}
}

impl<'de, 'a, E> IntoDeserializer<'de, E> for BytesDeserializer<'a, E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<'a, E> Debug for BytesDeserializer<'a, E> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter
Expand Down Expand Up @@ -873,6 +975,17 @@ where
}
}

impl<'de, E> IntoDeserializer<'de, E> for BorrowedBytesDeserializer<'de, E>
where
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<'de, E> Debug for BorrowedBytesDeserializer<'de, E> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter
Expand Down Expand Up @@ -952,6 +1065,19 @@ where
}
}

impl<'de, I, T, E> IntoDeserializer<'de, E> for SeqDeserializer<I, E>
where
I: Iterator<Item = T>,
T: IntoDeserializer<'de, E>,
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<'de, I, T, E> de::SeqAccess<'de> for SeqDeserializer<I, E>
where
I: Iterator<Item = T>,
Expand Down Expand Up @@ -1083,6 +1209,17 @@ where
}
}

impl<'de, A> IntoDeserializer<'de, A::Error> for SeqAccessDeserializer<A>
where
A: de::SeqAccess<'de>,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

////////////////////////////////////////////////////////////////////////////////

/// A deserializer that iterates over a map.
Expand Down Expand Up @@ -1197,6 +1334,21 @@ where
}
}

impl<'de, I, E> IntoDeserializer<'de, E> for MapDeserializer<'de, I, E>
where
I: Iterator,
I::Item: private::Pair,
First<I::Item>: IntoDeserializer<'de, E>,
Second<I::Item>: IntoDeserializer<'de, E>,
E: de::Error,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<'de, I, E> de::MapAccess<'de> for MapDeserializer<'de, I, E>
where
I: Iterator,
Expand Down Expand Up @@ -1498,6 +1650,17 @@ where
}
}

impl<'de, A> IntoDeserializer<'de, A::Error> for MapAccessDeserializer<A>
where
A: de::MapAccess<'de>,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

impl<'de, A> de::EnumAccess<'de> for MapAccessDeserializer<A>
where
A: de::MapAccess<'de>,
Expand Down Expand Up @@ -1551,6 +1714,17 @@ where
}
}

impl<'de, A> IntoDeserializer<'de, A::Error> for EnumAccessDeserializer<A>
where
A: de::EnumAccess<'de>,
{
type Deserializer = Self;

fn into_deserializer(self) -> Self {
self
}
}

////////////////////////////////////////////////////////////////////////////////

mod private {
Expand Down
2 changes: 1 addition & 1 deletion serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
////////////////////////////////////////////////////////////////////////////////

// Serde types in rustdoc of other crates get linked to here.
#![doc(html_root_url = "https://docs.rs/serde/1.0.213")]
#![doc(html_root_url = "https://docs.rs/serde/1.0.214")]
// Support using Serde without the standard library!
#![cfg_attr(not(feature = "std"), no_std)]
// Show which crate feature enables conditionally compiled APIs in documentation.
Expand Down
2 changes: 1 addition & 1 deletion serde_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde_derive"
version = "1.0.213"
version = "1.0.214"
authors = ["Erick Tryzelaar <[email protected]>", "David Tolnay <[email protected]>"]
categories = ["no-std", "no-std::no-alloc"]
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
Expand Down
2 changes: 1 addition & 1 deletion serde_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.213")]
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.214")]
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
// Ignored clippy lints
#![allow(
Expand Down

0 comments on commit 5114bbb

Please sign in to comment.