Remove unnecessary Deserializer lifetime

This commit is contained in:
Dirkjan Ochtman 2022-11-26 14:56:33 -08:00
parent 508d29ccaa
commit c24d2cdaac
3 changed files with 14 additions and 14 deletions

View File

@ -56,7 +56,7 @@ fn deserialize_scalar_enum(
quote!(
impl #impl_generics FromXml<'xml> for #ident #ty_generics #where_clause {
fn deserialize<'cx>(
deserializer: &'cx mut ::instant_xml::Deserializer<'cx, 'xml>,
deserializer: &mut ::instant_xml::Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), ::instant_xml::Error> {
use ::instant_xml::Error;
@ -138,7 +138,7 @@ fn deserialize_wrapped_enum(
quote!(
impl #xml_impl_generics FromXml<'xml> for #ident #ty_generics #where_clause {
fn deserialize<'cx>(
deserializer: &'cx mut ::instant_xml::Deserializer<'cx, 'xml>,
deserializer: &mut ::instant_xml::Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), ::instant_xml::Error> {
use ::instant_xml::de::Node;
@ -245,7 +245,7 @@ fn deserialize_struct(
quote!(
impl #xml_impl_generics FromXml<'xml> for #ident #ty_generics #where_clause {
fn deserialize<'cx>(
deserializer: &'cx mut ::instant_xml::Deserializer<'cx, 'xml>,
deserializer: &mut ::instant_xml::Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), ::instant_xml::Error> {
use ::instant_xml::de::Node;
@ -414,7 +414,7 @@ fn deserialize_tuple_struct(
quote!(
impl #xml_impl_generics FromXml<'xml> for #ident #ty_generics #where_clause {
fn deserialize<'cx>(
deserializer: &'cx mut ::instant_xml::Deserializer<'cx, 'xml>,
deserializer: &mut ::instant_xml::Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), ::instant_xml::Error> {
use ::instant_xml::de::Node;
@ -488,7 +488,7 @@ fn deserialize_unit_struct(input: &syn::DeriveInput, meta: &ContainerMeta) -> To
quote!(
impl #xml_impl_generics FromXml<'xml> for #ident #ty_generics #where_clause {
fn deserialize<'cx>(
deserializer: &'cx mut ::instant_xml::Deserializer<'cx, 'xml>,
deserializer: &mut ::instant_xml::Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), ::instant_xml::Error> {
deserializer.ignore()?;

View File

@ -34,7 +34,7 @@ impl<'xml, T: FromStr> FromXml<'xml> for FromXmlStr<T> {
impl<'xml> FromXml<'xml> for bool {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error> {
if into.is_some() {
@ -107,7 +107,7 @@ macro_rules! from_xml_for_number {
($typ:ty) => {
impl<'xml> FromXml<'xml> for $typ {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error> {
if into.is_some() {
@ -145,7 +145,7 @@ from_xml_for_number!(f64);
impl<'xml> FromXml<'xml> for char {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error> {
if into.is_some() {
@ -168,7 +168,7 @@ impl<'xml> FromXml<'xml> for char {
impl<'xml> FromXml<'xml> for String {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error> {
if into.is_some() {
@ -191,7 +191,7 @@ impl<'xml> FromXml<'xml> for String {
impl<'xml> FromXml<'xml> for &'xml str {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error> {
if into.is_some() {
@ -234,7 +234,7 @@ impl<'xml> FromXml<'xml> for Cow<'xml, str> {
impl<'xml, T: FromXml<'xml>> FromXml<'xml> for Option<T> {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error> {
if into.is_some() {
@ -436,7 +436,7 @@ fn decode(input: &str) -> Cow<'_, str> {
impl<'xml, T: FromXml<'xml>> FromXml<'xml> for Vec<T> {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error> {
let mut value = None;
@ -503,7 +503,7 @@ impl ToXml for DateTime<Utc> {
#[cfg(feature = "chrono")]
impl<'xml> FromXml<'xml> for DateTime<Utc> {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error> {
if into.is_some() {

View File

@ -37,7 +37,7 @@ impl<'a, T: ToXml + ?Sized> ToXml for &'a T {
pub trait FromXml<'xml>: Sized {
fn deserialize<'cx>(
deserializer: &'cx mut Deserializer<'cx, 'xml>,
deserializer: &mut Deserializer<'cx, 'xml>,
into: &mut Option<Self>,
) -> Result<(), Error>;