Update dependencies

This commit is contained in:
Jonas Platte 2019-08-16 21:42:26 +02:00
parent ef2535a7c2
commit 3b3744153f
4 changed files with 20 additions and 25 deletions

View File

@ -19,21 +19,21 @@ serde_urlencoded = "0.6.1"
ruma-identifiers = "0.14.0"
[dependencies.percent-encoding]
version = "2.0.0"
version = "2.1.0"
optional = true
[dependencies.ruma-api-macros]
version = "0.7.0"
version = "0.7.1"
path = "ruma-api-macros"
optional = true
[dependencies.serde]
version = "1.0.98"
version = "1.0.99"
features = ["derive"]
optional = true
[dependencies.url]
version = "2.0.0"
version = "2.1.0"
optional = true
[features]

View File

@ -13,11 +13,11 @@ version = "0.7.1"
edition = "2018"
[dependencies]
quote = "0.6.13"
proc-macro2 = "0.4.30"
quote = "1.0.1"
proc-macro2 = "1.0.1"
[dependencies.syn]
version = "0.15.42"
version = "1.0.2"
features = ["full"]
[lib]

View File

@ -1,7 +1,6 @@
//! Details of the `#[ruma_api(...)]` attributes.
use syn::{
parenthesized,
parse::{Parse, ParseStream},
Ident, Token,
};
@ -24,7 +23,8 @@ impl Meta {
segments,
} => {
if segments.len() == 1 && segments[0].ident == "ruma_api" {
Ok(syn::parse2(attr.tts)
Ok(attr
.parse_args()
.expect("ruma_api! could not parse request field attributes"))
} else {
Err(attr)
@ -46,15 +46,13 @@ pub struct MetaNameValue {
impl Parse for Meta {
fn parse(input: ParseStream) -> syn::Result<Self> {
let content;
let _ = parenthesized!(content in input);
let ident = content.parse()?;
let ident = input.parse()?;
if content.peek(Token![=]) {
let _ = content.parse::<Token![=]>();
if input.peek(Token![=]) {
let _ = input.parse::<Token![=]>();
Ok(Meta::NameValue(MetaNameValue {
name: ident,
value: content.parse()?,
value: input.parse()?,
}))
} else {
Ok(Meta::Word(ident))

View File

@ -24,19 +24,16 @@ pub fn strip_serde_attrs(field: &Field) -> Field {
.into_iter()
.filter(|attr| {
let meta = attr
.interpret_meta()
.parse_meta()
.expect("ruma_api! could not parse field attributes");
let meta_list = match meta {
Meta::List(meta_list) => meta_list,
_ => return true,
};
if &meta_list.ident.to_string() == "serde" {
return false;
match meta {
Meta::List(meta_list) => {
let segments = &meta_list.path.segments;
segments.len() != 1 || segments[0].ident != "serde"
}
_ => true,
}
true
})
.collect();