Skip to content

Commit 9f86113

Browse files
committed
Address clippy warnings
1 parent fd4a154 commit 9f86113

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

graphql_client_codegen/src/generated_module.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ impl<'a> GeneratedModule<'a> {
8484
#module_visibility mod #module_name {
8585
#![allow(dead_code)]
8686

87+
use std::result::Result;
88+
8789
pub const OPERATION_NAME: &'static str = #operation_name;
8890
pub const QUERY: &'static str = #query_string;
8991

graphql_client_codegen/src/query.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,9 @@ fn create_roots(
172172
graphql_parser::query::Definition::Operation(
173173
graphql_parser::query::OperationDefinition::SelectionSet(_),
174174
) => {
175-
return Err(QueryValidationError::new(format!(
176-
"{}",
177-
crate::constants::SELECTION_SET_AT_ROOT
178-
)))
175+
return Err(QueryValidationError::new(
176+
crate::constants::SELECTION_SET_AT_ROOT.to_owned(),
177+
))
179178
}
180179
}
181180
}
@@ -406,9 +405,10 @@ fn resolve_operation(
406405
match operation {
407406
graphql_parser::query::OperationDefinition::Mutation(m) => {
408407
let on = schema.mutation_type().ok_or_else(|| {
409-
QueryValidationError::new(format!(
408+
QueryValidationError::new(
410409
"Query contains a mutation operation, but the schema has no mutation type."
411-
))
410+
.to_owned(),
411+
)
412412
})?;
413413
let on = schema.get_object(on);
414414

0 commit comments

Comments
 (0)