From 147ea980bf6e1f9639623a3b45d1d48f3f1375c0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 25 Apr 2020 16:47:33 +0200 Subject: [PATCH] move to Rust 1.42 features --- README.md | 4 ++-- README.tpl | 4 ++-- gotham_restful_derive/src/lib.rs | 2 -- gotham_restful_derive/src/method.rs | 15 +++------------ 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6815044..51700af 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Build with Rust - - Minimum Rust Version + + Minimum Rust Version
diff --git a/README.tpl b/README.tpl index a148bef..5be3b7f 100644 --- a/README.tpl +++ b/README.tpl @@ -17,8 +17,8 @@ Build with Rust - - Minimum Rust Version + + Minimum Rust Version
diff --git a/gotham_restful_derive/src/lib.rs b/gotham_restful_derive/src/lib.rs index 71017d9..4a98a9d 100644 --- a/gotham_restful_derive/src/lib.rs +++ b/gotham_restful_derive/src/lib.rs @@ -1,5 +1,3 @@ -extern crate proc_macro; - use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::quote; diff --git a/gotham_restful_derive/src/method.rs b/gotham_restful_derive/src/method.rs index 098c4c7..d83f6ab 100644 --- a/gotham_restful_derive/src/method.rs +++ b/gotham_restful_derive/src/method.rs @@ -134,26 +134,17 @@ impl MethodArgumentType { fn is_method_arg(&self) -> bool { - match self { - Self::MethodArg(_) => true, - _ => false, - } + matches!(self, Self::MethodArg(_)) } fn is_database_conn(&self) -> bool { - match self { - Self::DatabaseConnection(_) => true, - _ => false - } + matches!(self, Self::DatabaseConnection(_)) } fn is_auth_status(&self) -> bool { - match self { - Self::AuthStatus(_) | Self::AuthStatusRef(_) => true, - _ => false - } + matches!(self, Self::AuthStatus(_) | Self::AuthStatusRef(_)) } fn quote_ty(&self) -> Option