update codegen to the content changes

This commit is contained in:
Oliver Schneider 2017-02-04 10:37:50 +01:00
parent e68888d475
commit 393b19ee8a
3 changed files with 10 additions and 6 deletions

View File

@ -570,7 +570,8 @@ impl<E> Deserializer for ContentDeserializer<E>
}
impl<E> ContentDeserializer<E> {
fn new(content: Content) -> Self {
/// private API, don't use
pub fn new(content: Content) -> Self {
ContentDeserializer {
content: content,
err: PhantomData,
@ -655,7 +656,8 @@ impl<'a, E> Deserializer for ContentRefDeserializer<'a, E>
}
impl<'a, E> ContentRefDeserializer<'a, E> {
fn new(content: &'a Content) -> Self {
/// private API, don't use
pub fn new(content: &'a Content) -> Self {
ContentRefDeserializer {
content: content,
err: PhantomData,

View File

@ -5,6 +5,8 @@ use de::{Deserialize, Deserializer, Error, Visitor};
#[cfg(any(feature = "std", feature = "collections"))]
pub use de::content::{
Content,
ContentRefDeserializer,
ContentDeserializer,
TaggedContentVisitor,
InternallyTaggedUnitVisitor,
UntaggedUnitVisitor,

View File

@ -704,7 +704,7 @@ fn deserialize_internally_tagged_enum(
ty.clone(),
variant,
item_attrs,
quote!(_tagged.content),
quote!(_serde::de::private::ContentDeserializer::<__D::Error>::new(_tagged.content)),
);
quote! {
@ -719,7 +719,7 @@ fn deserialize_internally_tagged_enum(
let _tagged = try!(_serde::Deserializer::deserialize(
deserializer,
_serde::de::private::TaggedContentVisitor::<__Field, __D::Error>::new(#tag)));
_serde::de::private::TaggedContentVisitor::<__Field>::new(#tag)));
match _tagged.tag {
#(#variant_arms)*
@ -743,7 +743,7 @@ fn deserialize_untagged_enum(
ty.clone(),
variant,
item_attrs,
quote!(&_content),
quote!(_serde::de::private::ContentRefDeserializer::<__D::Error>::new(&_content)),
)
});
@ -756,7 +756,7 @@ fn deserialize_untagged_enum(
let fallthrough_msg = format!("data did not match any variant of untagged enum {}", type_ident);
quote!({
let _content = try!(<_serde::de::private::Content<__D::Error> as _serde::Deserialize>::deserialize(deserializer));
let _content = try!(<_serde::de::private::Content as _serde::Deserialize>::deserialize(deserializer));
#(
if let _serde::export::Ok(ok) = #attempts {