diff --git a/README.md b/README.md index 1660926..f21a345 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Rustify is a small library written in Rust which eases the burden of scaffolding HTTP APIs. It provides an `Endpoint` trait along with a macro helper which allows templating various remote endpoints. Both asynchronous and -synchrounous clients are offered for executing requests against endpoints with +synchronous clients are offered for executing requests against endpoints with the option of implementing custom clients using the `Client` trait. Rustify provides support for serializing requests and deserializing responses. diff --git a/rustify_derive/src/lib.rs b/rustify_derive/src/lib.rs index c317904..b0acead 100644 --- a/rustify_derive/src/lib.rs +++ b/rustify_derive/src/lib.rs @@ -271,11 +271,7 @@ fn endpoint_derive(s: synstructure::Structure) -> proc_macro2::TokenStream { // Find serde attributes let serde_attrs = parse::attributes(&s.ast().attrs, "serde"); - let serde_attrs = if let Ok(v) = serde_attrs { - v - } else { - Vec::::new() - }; + let serde_attrs = serde_attrs.unwrap_or_default(); // Generate path string let path = match gen_path(&path) { @@ -305,6 +301,7 @@ fn endpoint_derive(s: synstructure::Structure) -> proc_macro2::TokenStream { let const_name = format!("_DERIVE_Endpoint_FOR_{}", id); let const_ident = Ident::new(const_name.as_str(), Span::call_site()); quote! { + #[allow(non_local_definitions)] const #const_ident: () = { use rustify::__private::serde::Serialize; use rustify::http::{build_body, build_query}; diff --git a/rustify_derive/src/parse.rs b/rustify_derive/src/parse.rs index bde3640..ec42952 100644 --- a/rustify_derive/src/parse.rs +++ b/rustify_derive/src/parse.rs @@ -96,11 +96,9 @@ pub(crate) fn attributes(attrs: &[Attribute], name: &str) -> Result, E let mut result = Vec::::new(); for attr in attrs.iter() { let meta = attr.parse_meta().map_err(Error::from)?; - match meta.path().is_ident(name) { - true => { - result.push(meta); - } - false => {} + + if meta.path().is_ident(name) { + result.push(meta); } } diff --git a/src/lib.rs b/src/lib.rs index 626cbbf..0d55508 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,7 +17,7 @@ //! Rustify is a small library written in Rust which eases the burden of //! scaffolding HTTP APIs. It provides an `Endpoint` trait along with a macro helper //! which allows templating various remote endpoints. Both asynchronous and -//! synchrounous clients are offered for executing requests against endpoints with +//! synchronous clients are offered for executing requests against endpoints with //! the option of implementing custom clients using the `Client` trait. //! //! Rustify provides support for serializing requests and deserializing responses.