Skip to content

Commit 37e15f5

Browse files
committed
ok
1 parent 80c1290 commit 37e15f5

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/validation/rules/values_of_correct_type.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ impl ValuesOfCorrectType {
2828
}
2929

3030
pub fn is_custom_scalar(&self, type_name: &str) -> bool {
31-
match type_name {
32-
"String" | "Int" | "Float" | "Boolean" | "ID" => false,
33-
_ => true,
34-
}
31+
!matches!(type_name, "String" | "Int" | "Float" | "Boolean" | "ID")
3532
}
3633

3734
pub fn validate_value(
@@ -84,10 +81,7 @@ impl ValuesOfCorrectType {
8481
if let TypeDefinition::Enum(enum_type_def) = &type_def {
8582
match raw_value {
8683
Value::Enum(enum_value) => {
87-
if !enum_type_def
88-
.values
89-
.iter().any(|v| v.name.eq(enum_value))
90-
{
84+
if !enum_type_def.values.iter().any(|v| v.name.eq(enum_value)) {
9185
user_context.report_error(ValidationError {
9286
error_code: self.error_code(),
9387
message: format!(
@@ -156,7 +150,8 @@ impl<'a> OperationVisitor<'a, ValidationErrorContext> for ValuesOfCorrectType {
156150
object_value.keys().for_each(|field_name| {
157151
if !input_object_def
158152
.fields
159-
.iter().any(|f| f.name.eq(field_name))
153+
.iter()
154+
.any(|f| f.name.eq(field_name))
160155
{
161156
user_context.report_error(ValidationError {
162157
error_code: self.error_code(),

0 commit comments

Comments
 (0)