From e03a6ea0879d427f29beba1691980b9b64b11e10 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 1 Sep 2022 11:02:24 +0200 Subject: [PATCH] Rename get_namespaces() to namespaces() --- instant-xml-macros/src/de.rs | 4 ++-- instant-xml-macros/src/lib.rs | 4 +--- instant-xml-macros/src/se.rs | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/instant-xml-macros/src/de.rs b/instant-xml-macros/src/de.rs index 979f25b..27b730f 100644 --- a/instant-xml-macros/src/de.rs +++ b/instant-xml-macros/src/de.rs @@ -1,7 +1,7 @@ use proc_macro2::{Ident, Span, TokenStream}; use quote::{quote, ToTokens}; -use crate::{get_namespaces, retrieve_field_attribute, FieldAttribute}; +use crate::{namespaces, retrieve_field_attribute, FieldAttribute}; struct Tokens { enum_: TokenStream, @@ -56,7 +56,7 @@ impl Deserializer { let name = ident.to_string(); let mut out = TokenStream::new(); - let (default_namespace, other_namespaces) = get_namespaces(&input.attrs); + let (default_namespace, other_namespaces) = namespaces(&input.attrs); let mut namespaces_map = quote!(let mut namespaces_map = std::collections::HashMap::new();); for (k, v) in other_namespaces.iter() { diff --git a/instant-xml-macros/src/lib.rs b/instant-xml-macros/src/lib.rs index 2411889..2d4484f 100644 --- a/instant-xml-macros/src/lib.rs +++ b/instant-xml-macros/src/lib.rs @@ -19,9 +19,7 @@ pub(crate) enum FieldAttribute { Attribute, } -pub(crate) fn get_namespaces( - attributes: &Vec, -) -> (String, HashMap) { +pub(crate) fn namespaces(attributes: &Vec) -> (String, HashMap) { let mut default_namespace = String::new(); let mut other_namespaces = HashMap::default(); diff --git a/instant-xml-macros/src/se.rs b/instant-xml-macros/src/se.rs index e2917b1..30bdb5a 100644 --- a/instant-xml-macros/src/se.rs +++ b/instant-xml-macros/src/se.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use proc_macro2::TokenStream; use quote::quote; -use crate::{get_namespaces, retrieve_field_attribute, FieldAttribute}; +use crate::{namespaces, retrieve_field_attribute, FieldAttribute}; pub struct Serializer { default_namespace: String, @@ -12,7 +12,7 @@ pub struct Serializer { impl<'a> Serializer { pub fn new(attributes: &'a Vec) -> Serializer { - let (default_namespace, other_namespaces) = get_namespaces(attributes); + let (default_namespace, other_namespaces) = namespaces(attributes); Serializer { default_namespace,