Skip to content

Commit eaacdfe

Browse files
Merge pull request #24 from stormshield-gt/fix-clippy-lints
Fix CI
2 parents 3dab7b3 + e420482 commit eaacdfe

File tree

4 files changed

+7
-12
lines changed

4 files changed

+7
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Rustify is a small library written in Rust which eases the burden of
1818
scaffolding HTTP APIs. It provides an `Endpoint` trait along with a macro helper
1919
which allows templating various remote endpoints. Both asynchronous and
20-
synchrounous clients are offered for executing requests against endpoints with
20+
synchronous clients are offered for executing requests against endpoints with
2121
the option of implementing custom clients using the `Client` trait.
2222

2323
Rustify provides support for serializing requests and deserializing responses.

rustify_derive/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,7 @@ fn endpoint_derive(s: synstructure::Structure) -> proc_macro2::TokenStream {
271271

272272
// Find serde attributes
273273
let serde_attrs = parse::attributes(&s.ast().attrs, "serde");
274-
let serde_attrs = if let Ok(v) = serde_attrs {
275-
v
276-
} else {
277-
Vec::<Meta>::new()
278-
};
274+
let serde_attrs = serde_attrs.unwrap_or_default();
279275

280276
// Generate path string
281277
let path = match gen_path(&path) {
@@ -305,6 +301,7 @@ fn endpoint_derive(s: synstructure::Structure) -> proc_macro2::TokenStream {
305301
let const_name = format!("_DERIVE_Endpoint_FOR_{}", id);
306302
let const_ident = Ident::new(const_name.as_str(), Span::call_site());
307303
quote! {
304+
#[allow(non_local_definitions)]
308305
const #const_ident: () = {
309306
use rustify::__private::serde::Serialize;
310307
use rustify::http::{build_body, build_query};

rustify_derive/src/parse.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,9 @@ pub(crate) fn attributes(attrs: &[Attribute], name: &str) -> Result<Vec<Meta>, E
9696
let mut result = Vec::<Meta>::new();
9797
for attr in attrs.iter() {
9898
let meta = attr.parse_meta().map_err(Error::from)?;
99-
match meta.path().is_ident(name) {
100-
true => {
101-
result.push(meta);
102-
}
103-
false => {}
99+
100+
if meta.path().is_ident(name) {
101+
result.push(meta);
104102
}
105103
}
106104

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! Rustify is a small library written in Rust which eases the burden of
1818
//! scaffolding HTTP APIs. It provides an `Endpoint` trait along with a macro helper
1919
//! which allows templating various remote endpoints. Both asynchronous and
20-
//! synchrounous clients are offered for executing requests against endpoints with
20+
//! synchronous clients are offered for executing requests against endpoints with
2121
//! the option of implementing custom clients using the `Client` trait.
2222
//!
2323
//! Rustify provides support for serializing requests and deserializing responses.

0 commit comments

Comments
 (0)