Rename get_namespaces() to namespaces()

This commit is contained in:
Dirkjan Ochtman 2022-09-01 11:02:24 +02:00
parent d623fa32ab
commit e03a6ea087
3 changed files with 5 additions and 7 deletions

View File

@ -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() {

View File

@ -19,9 +19,7 @@ pub(crate) enum FieldAttribute {
Attribute,
}
pub(crate) fn get_namespaces(
attributes: &Vec<syn::Attribute>,
) -> (String, HashMap<String, String>) {
pub(crate) fn namespaces(attributes: &Vec<syn::Attribute>) -> (String, HashMap<String, String>) {
let mut default_namespace = String::new();
let mut other_namespaces = HashMap::default();

View File

@ -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<syn::Attribute>) -> Serializer {
let (default_namespace, other_namespaces) = get_namespaces(attributes);
let (default_namespace, other_namespaces) = namespaces(attributes);
Serializer {
default_namespace,