diff --git a/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs b/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs index 45d79630..763f89af 100644 --- a/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs +++ b/integration_tests/juniper_tests/src/codegen/derive_object_with_raw_idents.rs @@ -10,6 +10,7 @@ pub struct Query; #[juniper::graphql_object] impl Query { fn r#type(r#fn: MyInputType) -> Vec { + let _ = r#fn; unimplemented!() } } diff --git a/juniper/src/ast.rs b/juniper/src/ast.rs index 2881515b..37f95821 100644 --- a/juniper/src/ast.rs +++ b/juniper/src/ast.rs @@ -343,12 +343,12 @@ where } /// View the underlying int value, if present. - pub fn as_int_value<'a>(&'a self) -> Option { + pub fn as_int_value(&self) -> Option { self.as_scalar_value().and_then(|s| s.as_int()) } /// View the underlying float value, if present. - pub fn as_float_value<'a>(&'a self) -> Option { + pub fn as_float_value(&self) -> Option { self.as_scalar_value().and_then(|s| s.as_float()) } diff --git a/juniper/src/executor_tests/executor.rs b/juniper/src/executor_tests/executor.rs index 0b14f1ba..87bef837 100644 --- a/juniper/src/executor_tests/executor.rs +++ b/juniper/src/executor_tests/executor.rs @@ -1085,7 +1085,7 @@ mod named_operations { #[crate::graphql_object_internal] impl Schema { fn a(p: Option) -> &str { - dbg!(p); + let _ = p; "b" } } diff --git a/juniper/src/executor_tests/introspection/input_object.rs b/juniper/src/executor_tests/introspection/input_object.rs index bb5a6391..d7970ae7 100644 --- a/juniper/src/executor_tests/introspection/input_object.rs +++ b/juniper/src/executor_tests/introspection/input_object.rs @@ -1,3 +1,5 @@ +#![deny(unused_variables)] + use juniper_codegen::GraphQLInputObjectInternal as GraphQLInputObject; use crate::{ @@ -10,13 +12,13 @@ use crate::{ struct Root; -#[derive(GraphQLInputObject)] +#[derive(GraphQLInputObject, Debug)] struct DefaultName { field_one: String, field_two: String, } -#[derive(GraphQLInputObject)] +#[derive(GraphQLInputObject, Debug)] struct NoTrailingComma { field_one: String, field_two: String, @@ -96,6 +98,17 @@ impl Root { a10: NamedPublic, a11: FieldWithDefaults, ) -> i32 { + let _ = a1; + let _ = a2; + let _ = a3; + let _ = a4; + let _ = a5; + let _ = a6; + let _ = a7; + let _ = a8; + let _ = a9; + let _ = a10; + let _ = a11; 0 } } diff --git a/juniper/src/macros/tests/args.rs b/juniper/src/macros/tests/args.rs index f7292355..209b1bd6 100644 --- a/juniper/src/macros/tests/args.rs +++ b/juniper/src/macros/tests/args.rs @@ -134,8 +134,8 @@ impl Root { ), )] fn args_with_complex_default(arg1: String, arg2: Point) -> i32 { - dbg!(arg1); - dbg!(arg2); + let _ = arg1; + let _ = arg2; 0 } } diff --git a/juniper/src/util.rs b/juniper/src/util.rs index ccf7a16e..3a11108e 100644 --- a/juniper/src/util.rs +++ b/juniper/src/util.rs @@ -4,7 +4,7 @@ use std::borrow::Cow; /// /// Note: needs to be public because several macros use it. #[doc(hidden)] -pub fn to_camel_case<'a>(s: &'a str) -> Cow<'_, str> { +pub fn to_camel_case(s: &'_ str) -> Cow<'_, str> { let mut dest = Cow::Borrowed(s); for (i, part) in s.split('_').enumerate() { diff --git a/juniper_codegen/src/derive_input_object.rs b/juniper_codegen/src/derive_input_object.rs index 6b3acc31..ed42ae14 100644 --- a/juniper_codegen/src/derive_input_object.rs +++ b/juniper_codegen/src/derive_input_object.rs @@ -206,11 +206,13 @@ pub fn impl_input_object(ast: &syn::DeriveInput, is_internal: bool) -> TokenStre e.to_tokens(&mut tokens); Some(tokens) } - Err(_) => { + Err(e) => { + let _ = e; panic!("#graphql(default = ?) must be a valid Rust expression inside a string"); } }, - Err(_) => { + Err(e) => { + let _ = e; panic!("#graphql(default = ?) must be a valid Rust expression inside a string"); } },