Update dependencies.

This commit is contained in:
Ahmed Charles 2019-09-01 10:26:57 +00:00
parent f1927b2e5b
commit b08f1a964d
3 changed files with 14 additions and 22 deletions

View File

@ -13,15 +13,15 @@ repository = "https://github.com/ruma/ruma-api-macros"
version = "0.1.0" version = "0.1.0"
[dependencies] [dependencies]
syn = { version = "0.15.36", features = ["full"] } syn = { version = "1.0.4", features = ["full"] }
quote = "0.6.12" quote = "1.0.2"
proc-macro2 = "0.4.30" proc-macro2 = "1.0.1"
[lib] [lib]
proc-macro = true proc-macro = true
[dev-dependencies] [dev-dependencies]
ruma-identifiers = "0.13.1" ruma-identifiers = "0.14.0"
serde_json = "1.0.39" serde_json = "1.0.40"
js_int = { version = "0.1.0", features = ["serde"] } js_int = { version = "0.1.2", features = ["serde"] }
serde = { version = "1.0.92", features = ["derive"] } serde = { version = "1.0.99", features = ["derive"] }

View File

@ -557,13 +557,13 @@ fn populate_state_fields(is_custom: bool, content_name: Ident, fields: Vec<Field
/// Checks if the given `Path` refers to `EventType::Custom`. /// Checks if the given `Path` refers to `EventType::Custom`.
fn is_custom_event_type(event_type: &Path) -> bool { fn is_custom_event_type(event_type: &Path) -> bool {
event_type.segments.last().unwrap().value().ident == "Custom" event_type.segments.last().unwrap().ident == "Custom"
} }
/// Checks if a type is an `Option`. /// Checks if a type is an `Option`.
fn is_option(ty: &Type) -> bool { fn is_option(ty: &Type) -> bool {
if let Type::Path(ref type_path) = ty { if let Type::Path(ref type_path) = ty {
type_path.path.segments.first().unwrap().value().ident == "Option" type_path.path.segments.first().unwrap().ident == "Option"
} else { } else {
panic!("struct field had unexpected non-path type"); panic!("struct field had unexpected non-path type");
} }

View File

@ -81,20 +81,11 @@ impl Parse for RumaEventInput {
if ident == "kind" { if ident == "kind" {
let event_kind = match field_value.expr { let event_kind = match field_value.expr {
Expr::Path(expr_path) => { Expr::Path(expr_path) => {
if expr_path if expr_path.path.is_ident("Event") {
.path
.is_ident(Ident::new("Event", Span::call_site()))
{
EventKind::Event EventKind::Event
} else if expr_path } else if expr_path.path.is_ident("RoomEvent") {
.path
.is_ident(Ident::new("RoomEvent", Span::call_site()))
{
EventKind::RoomEvent EventKind::RoomEvent
} else if expr_path } else if expr_path.path.is_ident("StateEvent") {
.path
.is_ident(Ident::new("StateEvent", Span::call_site()))
{
EventKind::StateEvent EventKind::StateEvent
} else { } else {
panic!("value of field `kind` must be one of `Event`, `RoomEvent`, or `StateEvent`"); panic!("value of field `kind` must be one of `Event`, `RoomEvent`, or `StateEvent`");
@ -114,7 +105,7 @@ impl Parse for RumaEventInput {
} }
let path = expr_path.path; let path = expr_path.path;
let variant = path.segments.first().unwrap().into_value(); let variant = path.segments.first().unwrap();
let mut punctuated = Punctuated::new(); let mut punctuated = Punctuated::new();
punctuated.push(PathSegment { punctuated.push(PathSegment {
@ -189,6 +180,7 @@ pub enum Content {
} }
/// The style of field within the macro body. /// The style of field within the macro body.
#[allow(clippy::large_enum_variant)]
enum RumaEventField { enum RumaEventField {
/// The value of a field is a block with a type alias in it. /// The value of a field is a block with a type alias in it.
/// ///