update dependencies with 1.0 releases
This commit is contained in:
parent
64122a9e64
commit
dd5ca6df6b
@ -12,7 +12,7 @@ pub fn to_string<T: YaSerialize>(model: &T) -> Result<String, String> {
|
||||
Ok(String::from(data))
|
||||
}
|
||||
|
||||
pub fn to_string_with_config<T: YaSerialize>(model: &T, config: &Config) -> Result<String, String> {
|
||||
pub fn to_string_with_config<T: YaSerialize>(model: &T, _config: &Config) -> Result<String, String> {
|
||||
let buf = Cursor::new(Vec::new());
|
||||
let cursor = serialize_with_writer(model, buf)?;
|
||||
let data = str::from_utf8(cursor.get_ref()).expect("Found invalid UTF-8");
|
||||
|
||||
@ -11,9 +11,9 @@ documentation = "https://docs.rs/yaserde"
|
||||
readme = "../README.md"
|
||||
|
||||
[dependencies]
|
||||
syn = { version = "0.15.22", features = ["visit", "extra-traits"] }
|
||||
proc-macro2 = "0.4.24"
|
||||
quote = "0.6.10"
|
||||
syn = { version = "1.0.5", features = ["visit", "extra-traits"] }
|
||||
proc-macro2 = "1.0.5"
|
||||
quote = "1.0.2"
|
||||
|
||||
[lib]
|
||||
name = "yaserde_derive"
|
||||
|
||||
@ -40,7 +40,7 @@ impl YaSerdeAttribute {
|
||||
let mut text = false;
|
||||
|
||||
for attr in attrs.iter() {
|
||||
let mut attr_iter = attr.clone().tts.into_iter();
|
||||
let mut attr_iter = attr.clone().tokens.into_iter();
|
||||
if let Some(token) = attr_iter.next() {
|
||||
if let TokenTree::Group(group) = token {
|
||||
if group.delimiter() == Delimiter::Parenthesis {
|
||||
@ -146,7 +146,7 @@ fn parse_attributes() {
|
||||
leading_colon: None,
|
||||
segments: punctuated,
|
||||
},
|
||||
tts: TokenStream::from_str("(attribute)").unwrap(),
|
||||
tokens: TokenStream::from_str("(attribute)").unwrap(),
|
||||
}];
|
||||
|
||||
let attrs = YaSerdeAttribute::parse(&attributes);
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
use syn;
|
||||
use syn::punctuated::Pair;
|
||||
use syn::Type::Path;
|
||||
|
||||
#[derive(Debug)]
|
||||
@ -56,7 +55,7 @@ pub fn get_field_type(field: &syn::Field) -> Option<FieldType> {
|
||||
return None;
|
||||
}
|
||||
match path.path.segments.first() {
|
||||
Some(Pair::End(t)) => FieldType::from_ident(t),
|
||||
Some(path_segment) => FieldType::from_ident(path_segment),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -66,10 +65,10 @@ pub fn get_field_type(field: &syn::Field) -> Option<FieldType> {
|
||||
|
||||
fn get_sub_type(t: &syn::PathSegment) -> Option<syn::PathSegment> {
|
||||
if let syn::PathArguments::AngleBracketed(ref args) = t.arguments {
|
||||
if let Some(Pair::End(tt)) = args.args.first() {
|
||||
if let Some(tt) = args.args.first() {
|
||||
if let syn::GenericArgument::Type(ref argument) = *tt {
|
||||
if let Path(ref path2) = *argument {
|
||||
if let Some(Pair::End(ttt)) = path2.path.segments.first() {
|
||||
if let Some(ttt) = path2.path.segments.first() {
|
||||
return Some(ttt.clone());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user