Skip to content

Commit

Permalink
Merge pull request #24 from stormshield-gt/fix-clippy-lints
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
stormshield-gt authored Dec 12, 2024
2 parents 3dab7b3 + e420482 commit eaacdfe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 2 additions & 5 deletions rustify_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Meta>::new()
};
let serde_attrs = serde_attrs.unwrap_or_default();

// Generate path string
let path = match gen_path(&path) {
Expand Down Expand Up @@ -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};
Expand Down
8 changes: 3 additions & 5 deletions rustify_derive/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,9 @@ pub(crate) fn attributes(attrs: &[Attribute], name: &str) -> Result<Vec<Meta>, E
let mut result = Vec::<Meta>::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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit eaacdfe

Please sign in to comment.