Skip to content

pedantic Clippy fixes #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cba75ea
fix formatting
Feb 11, 2025
e732145
use inline format args (clippy::uninlined_format_args)
Jan 31, 2025
9fc24cc
use 'Self' keyword (clippy::use_self)
Jan 31, 2025
890979d
use semicolon if nothing returned (clippy::semicolon_if_nothing_retur…
Jan 31, 2025
3fbac33
remove explicit 'iter' loops (clippy::explicit_iter_loop)
Jan 31, 2025
11d2494
avoid cloning when you can copy (clippy::cloned_instead_of_copied)
Jan 31, 2025
47f7315
remove unnecessary semicolons (clippy::unnecessary_semicolons)
Jan 31, 2025
fc76085
nest or patterns (clippy::unnested_or_patterns)
Jan 31, 2025
f78c26c
use 'if let' rather than single match 'else' block (clippy::single_ma…
Jan 31, 2025
b4a69b7
collapse some 'if else' blocks
Jan 31, 2025
81abeb1
remove needless raw string hashes (clippy::needless_raw_string_hashes)
Jan 31, 2025
72b4292
remove wildcard imports (clippy::wildcard_imports)
Jan 31, 2025
d43b207
bump MSRV
Jan 31, 2025
0e9fb1a
flip unnecessary booleans (clippy::if_not_else)
Jan 31, 2025
6188068
remove redundant 'else' block (clippy::redundant_else)
Jan 31, 2025
cf12498
use 'assert' macro (clippy::manual_assert)
Jan 31, 2025
11714a6
explicitly match unit values (clippy::ignored_unit_patterns)
Jan 31, 2025
50c184b
remove some redundant closures (clippy::redundant_closure)
danieleades Feb 2, 2025
d52a52d
remove use of 'lazy_static' (clippy::non_std_lazy_statics)
danieleades Feb 2, 2025
a65d465
bump msrv
danieleades Feb 2, 2025
6cf0477
remove some needlessly mutable references (clippy::needless_pass_by_r…
danieleades Feb 2, 2025
154d29d
general refactoring
danieleades Feb 2, 2025
2ec7fc9
deglob another import
danieleades Feb 2, 2025
bacc011
remove unnecessary wraps (clippy::unnecessary_wraps)
danieleades Feb 2, 2025
d2f53d0
minor refactoring
Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unnecessary wraps (clippy::unnecessary_wraps)
  • Loading branch information
danieleades authored and daniel.eades committed Feb 11, 2025
commit bacc0116f8c4e804d73246543e7344779313019a
10 changes: 4 additions & 6 deletions graphql_client_codegen/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
},
schema::{InputId, TypeId},
type_qualifiers::GraphqlTypeQualifier,
GeneralError, GraphQLClientCodegenOptions,
GraphQLClientCodegenOptions,
};
use heck::ToSnakeCase;
use proc_macro2::{Ident, Span, TokenStream};
Expand All @@ -23,7 +23,7 @@ pub(crate) fn response_for_query(
operation_id: OperationId,
options: &GraphQLClientCodegenOptions,
query: BoundQuery<'_>,
) -> Result<TokenStream, GeneralError> {
) -> TokenStream {
let serde = options.serde_path();

let all_used_types = all_used_types(operation_id, &query);
Expand All @@ -47,7 +47,7 @@ pub(crate) fn response_for_query(
let definitions =
render_response_data_fields(operation_id, options, &query).render(&response_derives);

let q = quote! {
quote! {
use #serde::{Serialize, Deserialize};
use super::*;

Expand All @@ -71,9 +71,7 @@ pub(crate) fn response_for_query(
#(#fragment_definitions)*

#definitions
};

Ok(q)
}
}

fn generate_variables_struct(
Expand Down
2 changes: 1 addition & 1 deletion graphql_client_codegen/src/generated_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl GeneratedModule<'_> {
query: self.resolved_query,
schema: self.schema,
},
)?)
))
}

fn root(&self) -> Result<OperationId, OperationNotFound> {
Expand Down