Drop unnecessary qualification of String outside of generated code

This commit is contained in:
Jonas Platte
2020-12-02 17:15:53 +01:00
parent d3ee4112e3
commit c455f12d23
8 changed files with 41 additions and 48 deletions

View File

@@ -273,7 +273,7 @@ impl Into<proc_macro2::TokenStream> for Field {
}
impl Into<String> for &Field {
fn into(self) -> std::string::String {
fn into(self) -> String {
match self {
Field::FieldString => "str".to_string(),
Field::FieldBool => "bool".to_string(),
@@ -294,7 +294,7 @@ impl Into<String> for &Field {
impl fmt::Display for Field {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let string_representation: std::string::String = self.into();
let string_representation: String = self.into();
write!(f, "{}", string_representation)
}
}

View File

@@ -182,7 +182,7 @@ fn build_unnamed_field_visitors(fields: &syn::FieldsUnnamed) -> TokenStream {
match field.get_type() {
Field::FieldStruct { struct_name } => {
let struct_id: std::string::String = struct_name
let struct_id: String = struct_name
.segments
.iter()
.map(|s| s.ident.to_string())

View File

@@ -66,7 +66,7 @@ pub fn parse(
.map(|field| YaSerdeField::new(field.clone()))
.map(|field| {
let struct_visitor = |struct_name: syn::Path| {
let struct_id: std::string::String = struct_name
let struct_id: String = struct_name
.segments
.iter()
.map(|s| s.ident.to_string())