refactor: fix fmt and clippy

This commit is contained in:
Marc-Antoine Arnaud 2024-01-03 17:38:52 +01:00
parent f997a85567
commit 04396aafb2
3 changed files with 3 additions and 5 deletions

View File

@ -4,10 +4,8 @@ extern crate yaserde;
extern crate yaserde_derive;
use log::debug;
use std::default;
use std::io::Read;
use std::str::FromStr;
use yaserde::de::{self, from_str};
use yaserde::de::from_str;
use yaserde::YaDeserialize;
fn init() {

View File

@ -293,7 +293,7 @@ impl From<&Field> for String {
Field::FieldU64 => "u64".to_string(),
Field::FieldF32 => "f32".to_string(),
Field::FieldF64 => "f64".to_string(),
Field::FieldStruct { struct_name } => quote!{#struct_name}.to_string(),
Field::FieldStruct { struct_name } => quote! {#struct_name}.to_string(),
_ => panic!("Not a simple type: {:?}", field),
}
}

View File

@ -294,7 +294,7 @@ pub fn parse(
Field::FieldStruct { struct_name } => visit_vec(
&quote! { .push(value) },
&Ident::new("visit_str", field.get_span()),
&build_visitor_ident(&label_name, field.get_span(), Some(&struct_name)),
&build_visitor_ident(&label_name, field.get_span(), Some(struct_name)),
),
Field::FieldOption { .. } | Field::FieldVec { .. } => unimplemented!("Not supported"),
simple_type => visit_vec(