Skip to content

Commit ec37638

Browse files
committed
Don't use allow dead_code
1 parent 3b72bba commit ec37638

12 files changed

+25
-48
lines changed

tests/alias.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ extern crate serde_json;
1111
query_path = "tests/alias/query.graphql",
1212
schema_path = "tests/alias/schema.graphql"
1313
)]
14-
#[allow(dead_code)]
15-
struct AliasQuery;
14+
pub struct AliasQuery;
1615

1716
#[test]
1817
fn alias() {
@@ -23,17 +22,11 @@ fn alias() {
2322
},
2423
});
2524

26-
let _type_name_test = alias_query::RustAliasQueryOuterAlias {
27-
inner_alias: None,
28-
};
25+
let _type_name_test = alias_query::RustAliasQueryOuterAlias { inner_alias: None };
2926

30-
let valid_alias =
31-
serde_json::from_value::<alias_query::ResponseData>(valid_response).unwrap();
27+
let valid_alias = serde_json::from_value::<alias_query::ResponseData>(valid_response).unwrap();
3228

33-
assert_eq!(
34-
valid_alias.alias.unwrap(),
35-
"127.0.1.2"
36-
);
29+
assert_eq!(valid_alias.alias.unwrap(), "127.0.1.2");
3730
assert_eq!(
3831
valid_alias.outer_alias.unwrap().inner_alias.unwrap(),
3932
"inner value"

tests/custom_scalars.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ type NetworkAddress = Ipv4Addr;
1616
query_path = "tests/custom_scalars/query.graphql",
1717
schema_path = "tests/custom_scalars/schema.graphql"
1818
)]
19-
#[allow(dead_code)]
20-
struct CustomScalarsQuery;
19+
pub struct CustomScalarsQuery;
2120

2221
#[test]
2322
fn custom_scalars() {

tests/deprecation.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,23 @@ extern crate serde_derive;
1010
query_path = "tests/deprecation/query.graphql",
1111
deprecated = "allow",
1212
)]
13-
#[allow(dead_code)]
14-
struct AllowDeprecation;
13+
pub struct AllowDeprecation;
1514

1615
#[derive(GraphQLQuery)]
1716
#[graphql(
1817
schema_path = "tests/deprecation/schema.graphql",
1918
query_path = "tests/deprecation/query.graphql",
2019
deprecated = "deny",
2120
)]
22-
#[allow(dead_code)]
23-
struct DenyDeprecation;
21+
pub struct DenyDeprecation;
2422

25-
#[allow(deprecated)]
2623
#[derive(GraphQLQuery)]
2724
#[graphql(
2825
schema_path = "tests/deprecation/schema.graphql",
2926
query_path = "tests/deprecation/query.graphql",
3027
deprecated = "warn",
3128
)]
32-
#[allow(dead_code)]
33-
#[allow(deprecated)]
34-
struct WarnDeprecation;
29+
pub struct WarnDeprecation;
3530

3631
#[test]
3732
fn deprecation_allow() {

tests/fragments.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ extern crate serde_json;
1111
query_path = "tests/fragments/query.graphql",
1212
schema_path = "tests/fragments/schema.graphql"
1313
)]
14-
#[allow(dead_code)]
15-
struct FragmentReference;
14+
pub struct FragmentReference;
1615

1716
#[test]
1817
fn fragment_reference() {
@@ -24,7 +23,10 @@ fn fragment_reference() {
2423
serde_json::from_value::<fragment_reference::ResponseData>(valid_response).unwrap();
2524

2625
assert_eq!(
27-
valid_fragment_reference.fragment_reference.in_fragment.unwrap(),
26+
valid_fragment_reference
27+
.fragment_reference
28+
.in_fragment
29+
.unwrap(),
2830
"value"
2931
);
3032
}

tests/input_object_variables.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ extern crate serde_json;
1111
schema_path = "tests/input_object_variables/input_object_variables_schema.graphql",
1212
response_derives = "Debug",
1313
)]
14-
#[allow(dead_code)]
15-
struct InputObjectVariablesQuery;
14+
pub struct InputObjectVariablesQuery;
1615

1716
#[test]
1817
fn input_object_variables_query_variables_struct() {
@@ -37,8 +36,7 @@ type Email = String;
3736
schema_path = "tests/input_object_variables/input_object_variables_schema.graphql",
3837
response_derives = "Debug",
3938
)]
40-
#[allow(dead_code)]
41-
struct DefaultInputObjectVariablesQuery;
39+
pub struct DefaultInputObjectVariablesQuery;
4240

4341
#[test]
4442
fn input_object_variables_default() {

tests/interfaces.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ const RESPONSE: &'static str = include_str!("interfaces/interface_response.json"
1313
schema_path = "tests/interfaces/interface_schema.graphql",
1414
response_derives = "Debug, PartialEq",
1515
)]
16-
#[allow(dead_code)]
17-
struct InterfaceQuery;
16+
pub struct InterfaceQuery;
1817

1918
#[test]
2019
fn interface_deserialization() {
@@ -61,8 +60,7 @@ fn interface_deserialization() {
6160
schema_path = "tests/interfaces/interface_schema.graphql",
6261
response_derives = "Debug",
6362
)]
64-
#[allow(dead_code)]
65-
struct InterfaceNotOnEverythingQuery;
63+
pub struct InterfaceNotOnEverythingQuery;
6664

6765
const RESPONSE_NOT_ON_EVERYTHING: &'static str =
6866
include_str!("interfaces/interface_response_not_on_everything.json");

tests/introspection.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ extern crate serde_json;
1111
schema_path = "tests/introspection/introspection_schema.graphql",
1212
response_derives = "Debug,PartialEq"
1313
)]
14-
#[allow(dead_code)]
15-
struct IntrospectionQuery;
14+
pub struct IntrospectionQuery;
1615

1716
#[test]
1817
fn introspection_schema() {

tests/more_derives.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ extern crate serde_derive;
1010
query_path = "tests/more_derives/query.graphql",
1111
response_derives = "Debug, PartialEq, PartialOrd",
1212
)]
13-
#[allow(dead_code)]
14-
struct MoreDerives;
13+
pub struct MoreDerives;
1514

1615
#[test]
1716
fn response_derives_can_be_added() {

tests/operation_selection.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ extern crate serde_json;
1111
schema_path = "tests/operation_selection/schema.graphql",
1212
response_derives = "Debug",
1313
)]
14-
#[allow(dead_code)]
15-
struct Heights;
14+
pub struct Heights;
1615

1716
#[derive(GraphQLQuery)]
1817
#[graphql(
1918
query_path = "tests/operation_selection/queries.graphql",
2019
schema_path = "tests/operation_selection/schema.graphql",
2120
response_derives = "Debug",
2221
)]
23-
#[allow(dead_code)]
24-
struct Echo;
22+
pub struct Echo;
2523

2624
const HEIGHTS_RESPONSE: &'static str = r##"{"mountainHeight": 224, "buildingHeight": 12}"##;
2725
const ECHO_RESPONSE: &'static str = r##"{"echo": "tiramisù"}"##;

tests/scalar_variables.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ extern crate serde_json;
1010
query_path = "tests/scalar_variables/scalar_variables_query.graphql",
1111
schema_path = "tests/scalar_variables/scalar_variables_schema.graphql"
1212
)]
13-
#[allow(dead_code)]
14-
struct ScalarVariablesQuery;
13+
pub struct ScalarVariablesQuery;
1514

1615
#[test]
1716
fn scalar_variables_query_variables_struct() {
@@ -26,8 +25,7 @@ fn scalar_variables_query_variables_struct() {
2625
query_path = "tests/scalar_variables/scalar_variables_query_defaults.graphql",
2726
schema_path = "tests/scalar_variables/scalar_variables_schema.graphql"
2827
)]
29-
#[allow(dead_code)]
30-
struct DefaultScalarVariablesQuery;
28+
pub struct DefaultScalarVariablesQuery;
3129

3230
#[test]
3331
fn scalar_variables_default() {

0 commit comments

Comments
 (0)