diff --git a/Cargo.toml b/Cargo.toml index 65ffad17..0b60a351 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "async-graphql" -version = "1.7.3" +version = "1.7.4" authors = ["sunli "] edition = "2018" description = "The GraphQL server library implemented by rust" @@ -18,7 +18,7 @@ default = ["bson", "uuid", "url", "chrono-tz", "validators"] validators = ["regex"] [dependencies] -async-graphql-derive = { path = "async-graphql-derive", version = "1.7.3" } +async-graphql-derive = { path = "async-graphql-derive", version = "1.7.4" } graphql-parser = "=0.2.3" anyhow = "1.0.26" thiserror = "1.0.11" diff --git a/async-graphql-actix-web/Cargo.toml b/async-graphql-actix-web/Cargo.toml index 3da2976b..454d3eb4 100644 --- a/async-graphql-actix-web/Cargo.toml +++ b/async-graphql-actix-web/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "async-graphql-actix-web" -version = "0.7.3" +version = "0.7.4" authors = ["sunli "] edition = "2018" description = "async-graphql for actix-web" @@ -13,7 +13,7 @@ keywords = ["futures", "async", "graphql"] categories = ["network-programming", "asynchronous"] [dependencies] -async-graphql = { path = "..", version = "1.7.3" } +async-graphql = { path = "..", version = "1.7.4" } actix-web = "2.0.0" actix-multipart = "0.2.0" actix-web-actors = "2.0.0" diff --git a/async-graphql-derive/Cargo.toml b/async-graphql-derive/Cargo.toml index 4b6c5876..28f73e4f 100644 --- a/async-graphql-derive/Cargo.toml +++ b/async-graphql-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "async-graphql-derive" -version = "1.7.3" +version = "1.7.4" authors = ["sunli "] edition = "2018" description = "Macros for async-graphql" diff --git a/src/registry.rs b/src/registry.rs index b9ea01ba..6c8de736 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -67,7 +67,7 @@ impl<'a> TypeName<'a> { pub fn unwrap_non_null(&self) -> Self { match self { TypeName::NonNull(ty) => TypeName::create(ty), - _ => self.clone(), + _ => *self, } } diff --git a/src/validation/rules/variables_in_allowed_position.rs b/src/validation/rules/variables_in_allowed_position.rs index 3d62ac5f..f8f36ae2 100644 --- a/src/validation/rules/variables_in_allowed_position.rs +++ b/src/validation/rules/variables_in_allowed_position.rs @@ -125,7 +125,7 @@ impl<'a> Visitor<'a> for VariableInAllowedPosition<'a> { self.variable_usages .entry(scope.clone()) .or_insert_with(Vec::new) - .push((name.as_str(), pos, expected_type.clone())); + .push((name.as_str(), pos, *expected_type)); } } } diff --git a/src/validation/utils.rs b/src/validation/utils.rs index 51d4b645..ede96259 100644 --- a/src/validation/utils.rs +++ b/src/validation/utils.rs @@ -166,10 +166,10 @@ pub fn is_valid_input_value( } } - for name in input_names { + if let Some(name) = input_names.iter().next() { return Some(valid_error( &path_node, - format!("unknown field \"{}\" of type \"{}\"", name, ty.name(),), + format!("unknown field \"{}\" of type \"{}\"", name, ty.name()), )); } diff --git a/src/validation/visitor.rs b/src/validation/visitor.rs index 1eaea30d..1fd974e5 100644 --- a/src/validation/visitor.rs +++ b/src/validation/visitor.rs @@ -633,7 +633,7 @@ fn visit_directives<'a, V: Visitor<'a>>( v.enter_argument(ctx, d.position, name, value); let expected_ty = schema_directive .and_then(|schema_directive| schema_directive.args.get(name.as_str())) - .and_then(|input_ty| Some(TypeName::create(&input_ty.ty))); + .map(|input_ty| TypeName::create(&input_ty.ty)); ctx.with_input_type(expected_ty, |ctx| { visit_input_value(v, ctx, d.position, expected_ty, value) });