From 6c7b8254e60183318570e98461b65c70d272808c Mon Sep 17 00:00:00 2001 From: Marc-Antoine Arnaud Date: Thu, 4 Jan 2024 08:53:10 +0100 Subject: [PATCH] build: fix fmt and correct unit tests --- xml_schema_derive/src/xsd/element.rs | 2 +- xml_schema_derive/src/xsd/extension.rs | 6 +++--- xml_schema_derive/src/xsd/schema.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xml_schema_derive/src/xsd/element.rs b/xml_schema_derive/src/xsd/element.rs index 17832e2..efee534 100644 --- a/xml_schema_derive/src/xsd/element.rs +++ b/xml_schema_derive/src/xsd/element.rs @@ -123,7 +123,7 @@ impl Element { } else { name }; - + let attribute_name = Ident::new(&name, Span::call_site()); let yaserde_rename = &self.name; diff --git a/xml_schema_derive/src/xsd/extension.rs b/xml_schema_derive/src/xsd/extension.rs index 536787f..7a3c5b8 100644 --- a/xml_schema_derive/src/xsd/extension.rs +++ b/xml_schema_derive/src/xsd/extension.rs @@ -36,7 +36,7 @@ impl Implementation for Extension { .map(|attribute| attribute.implement(namespace_definition, prefix, context)) .collect(); -let inner_attribute = if format!("{rust_type}") == "String" { + let inner_attribute = if format!("{rust_type}") == "String" { quote!(#[yaserde(text)]) } else { TokenStream::new() @@ -102,7 +102,7 @@ mod tests { let expected = TokenStream::from_str( r#" #[yaserde(text)] - pub content: String, + pub base: String, "#, ) .unwrap(); @@ -145,7 +145,7 @@ mod tests { let expected = TokenStream::from_str( r#" #[yaserde(text)] - pub content: String, + pub base: String, #[yaserde(attribute)] pub attribute_1: String, #[yaserde(attribute)] diff --git a/xml_schema_derive/src/xsd/schema.rs b/xml_schema_derive/src/xsd/schema.rs index e14ec5f..6c33ccd 100644 --- a/xml_schema_derive/src/xsd/schema.rs +++ b/xml_schema_derive/src/xsd/schema.rs @@ -1,4 +1,4 @@ - use crate::xsd::{ +use crate::xsd::{ attribute, attribute_group, complex_type, element, group, import, qualification, simple_type, Implementation, XsdContext, };