Merge pull request #1 from ahmedcharles/update

Update dependencies.
This commit is contained in:
Jimmy Cuadra 2019-09-02 19:31:04 -07:00 committed by GitHub
commit 659dc96394
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"
[dependencies]
syn = { version = "0.15.36", features = ["full"] }
quote = "0.6.12"
proc-macro2 = "0.4.30"
syn = { version = "1.0.4", features = ["full"] }
quote = "1.0.2"
proc-macro2 = "1.0.1"
[lib]
proc-macro = true
[dev-dependencies]
ruma-identifiers = "0.13.1"
serde_json = "1.0.39"
js_int = { version = "0.1.0", features = ["serde"] }
serde = { version = "1.0.92", features = ["derive"] }
ruma-identifiers = "0.14.0"
serde_json = "1.0.40"
js_int = { version = "0.1.2", features = ["serde"] }
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`.
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`.
fn is_option(ty: &Type) -> bool {
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 {
panic!("struct field had unexpected non-path type");
}

View File

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