Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Preserve is_human_readable setting of wrapped de/serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 3, 2023
1 parent ecdb5bf commit bb17d5e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ pub mod singleton_map {
{
self.delegate.collect_str(value)
}

fn is_human_readable(&self) -> bool {
self.delegate.is_human_readable()
}
}

struct SerializeTupleVariantAsSingletonMap<M> {
Expand Down Expand Up @@ -629,6 +633,10 @@ pub mod singleton_map {
{
self.delegate.deserialize_ignored_any(visitor)
}

fn is_human_readable(&self) -> bool {
self.delegate.is_human_readable()
}
}

struct SingletonMapAsEnum<D> {
Expand Down Expand Up @@ -1183,6 +1191,10 @@ pub mod singleton_map_recursive {
{
self.delegate.collect_str(value)
}

fn is_human_readable(&self) -> bool {
self.delegate.is_human_readable()
}
}

impl<D> SerializeSeq for SingletonMapRecursive<D>
Expand Down Expand Up @@ -1653,6 +1665,10 @@ pub mod singleton_map_recursive {
self.delegate
.deserialize_ignored_any(SingletonMapRecursive { delegate: visitor })
}

fn is_human_readable(&self) -> bool {
self.delegate.is_human_readable()
}
}

impl<'de, V> Visitor<'de> for SingletonMapRecursive<V>
Expand Down

0 comments on commit bb17d5e

Please sign in to comment.