From 54a1b64a7946e535b13664e2fee871ab0514d44c Mon Sep 17 00:00:00 2001 From: Christoph Herzog Date: Mon, 22 Apr 2019 20:37:46 +0200 Subject: [PATCH] Refactor code to 2018 edition with 'cargo fix --edition' --- .travis.yml | 2 +- integration_tests/juniper_tests/Cargo.toml | 1 + juniper/CHANGELOG.md | 3 +- juniper/Cargo.toml | 1 + juniper/src/ast.rs | 10 +- juniper/src/executor/look_ahead.rs | 42 ++++---- juniper/src/executor/mod.rs | 20 ++-- juniper/src/executor_tests/directives.rs | 10 +- juniper/src/executor_tests/enums.rs | 24 ++--- juniper/src/executor_tests/executor.rs | 100 +++++++++--------- .../src/executor_tests/interfaces_unions.rs | 16 +-- .../src/executor_tests/introspection/enums.rs | 10 +- .../introspection/input_object.rs | 12 +-- .../src/executor_tests/introspection/mod.rs | 18 ++-- juniper/src/executor_tests/variables.rs | 58 +++++----- juniper/src/http/mod.rs | 10 +- juniper/src/integrations/chrono.rs | 40 +++---- juniper/src/integrations/serde.rs | 16 +-- juniper/src/integrations/url.rs | 9 +- juniper/src/integrations/uuid.rs | 14 +-- juniper/src/lib.rs | 32 +++--- juniper/src/macros/tests/args.rs | 10 +- juniper/src/macros/tests/field.rs | 12 +-- juniper/src/macros/tests/interface.rs | 10 +- juniper/src/macros/tests/object.rs | 12 +-- juniper/src/macros/tests/scalar.rs | 10 +- juniper/src/macros/tests/union.rs | 10 +- juniper/src/parser/document.rs | 12 +-- juniper/src/parser/lexer.rs | 2 +- juniper/src/parser/parser.rs | 2 +- juniper/src/parser/tests/document.rs | 12 +-- juniper/src/parser/tests/lexer.rs | 2 +- juniper/src/parser/tests/value.rs | 14 +-- juniper/src/parser/value.rs | 10 +- juniper/src/schema/meta.rs | 10 +- juniper/src/schema/model.rs | 14 +-- juniper/src/schema/schema.rs | 16 +-- juniper/src/tests/introspection_tests.rs | 22 ++-- juniper/src/tests/query_tests.rs | 42 ++++---- juniper/src/tests/schema.rs | 4 +- juniper/src/tests/type_info_tests.rs | 14 +-- juniper/src/types/base.rs | 12 +-- juniper/src/types/containers.rs | 10 +- juniper/src/types/pointers.rs | 10 +- juniper/src/types/scalars.rs | 16 +-- juniper/src/types/utilities.rs | 8 +- juniper/src/validation/context.rs | 8 +- juniper/src/validation/input_value.rs | 14 +-- juniper/src/validation/multi_visitor.rs | 8 +- .../rules/arguments_of_correct_type.rs | 18 ++-- .../rules/default_values_of_correct_type.rs | 16 +-- .../rules/fields_on_correct_type.rs | 16 +-- .../rules/fragments_on_composite_types.rs | 14 +-- .../validation/rules/known_argument_names.rs | 16 +-- .../src/validation/rules/known_directives.rs | 18 ++-- .../validation/rules/known_fragment_names.rs | 14 +-- .../src/validation/rules/known_type_names.rs | 14 +-- .../rules/lone_anonymous_operation.rs | 14 +-- juniper/src/validation/rules/mod.rs | 6 +- .../validation/rules/no_fragment_cycles.rs | 14 +-- .../rules/no_undefined_variables.rs | 14 +-- .../validation/rules/no_unused_fragments.rs | 14 +-- .../validation/rules/no_unused_variables.rs | 14 +-- .../rules/overlapping_fields_can_be_merged.rs | 24 ++--- .../rules/possible_fragment_spreads.rs | 16 +-- .../rules/provided_non_null_arguments.rs | 18 ++-- juniper/src/validation/rules/scalar_leafs.rs | 14 +-- .../validation/rules/unique_argument_names.rs | 14 +-- .../validation/rules/unique_fragment_names.rs | 14 +-- .../rules/unique_input_field_names.rs | 14 +-- .../rules/unique_operation_names.rs | 14 +-- .../validation/rules/unique_variable_names.rs | 14 +-- .../rules/variables_are_input_types.rs | 14 +-- .../rules/variables_in_allowed_position.rs | 14 +-- juniper/src/validation/test_harness.rs | 18 ++-- juniper/src/validation/traits.rs | 8 +- juniper/src/validation/visitor.rs | 16 +-- juniper/src/value/mod.rs | 4 +- juniper/src/value/scalar.rs | 2 +- juniper_codegen/Cargo.toml | 1 + juniper_codegen/src/derive_enum.rs | 7 +- juniper_codegen/src/derive_input_object.rs | 4 +- juniper_codegen/src/derive_object.rs | 7 +- juniper_hyper/Cargo.toml | 1 + juniper_iron/Cargo.toml | 1 + juniper_rocket/Cargo.toml | 1 + juniper_warp/Cargo.toml | 1 + 87 files changed, 613 insertions(+), 604 deletions(-) diff --git a/.travis.yml b/.travis.yml index 86fd14cc..2c946354 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,8 @@ rust: - nightly # Prevent accidentally breaking older Rust versions + - 1.32.0 - 1.31.0 - - 1.30.0 matrix: include: diff --git a/integration_tests/juniper_tests/Cargo.toml b/integration_tests/juniper_tests/Cargo.toml index fa300fe0..bedc80d1 100644 --- a/integration_tests/juniper_tests/Cargo.toml +++ b/integration_tests/juniper_tests/Cargo.toml @@ -2,6 +2,7 @@ name = "juniper_tests" version = "0.1.0" publish = false +edition = "2018" [dependencies] juniper = { version = "0.11.0", path = "../../juniper" } diff --git a/juniper/CHANGELOG.md b/juniper/CHANGELOG.md index 02fe6717..72fbc72c 100644 --- a/juniper/CHANGELOG.md +++ b/juniper/CHANGELOG.md @@ -1,6 +1,7 @@ # master -- The minimum required Rust version is now `1.30.0`. +- Refactored all crates to the 2018 editio [#345](https://github.com/graphql-rust/juniper/pull/345) +- The minimum required Rust version is now `1.31.0`. - The `ScalarValue` custom derive has been renamed to `GraphQLScalarValue`. - Added built-in support for the canonical schema introspection query via `juniper::introspect()`. [#307](https://github.com/graphql-rust/juniper/issues/307) diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml index fec42203..a9123338 100644 --- a/juniper/Cargo.toml +++ b/juniper/Cargo.toml @@ -12,6 +12,7 @@ repository = "https://github.com/graphql-rust/juniper" readme = "../README.md" keywords = ["graphql", "server", "web", "rocket"] categories = ["web-programming"] +edition = "2018" [badges] travis-ci = { repository = "graphql-rust/juniper" } diff --git a/juniper/src/ast.rs b/juniper/src/ast.rs index 21da312e..076551d6 100644 --- a/juniper/src/ast.rs +++ b/juniper/src/ast.rs @@ -6,9 +6,9 @@ use std::vec; use indexmap::IndexMap; -use executor::Variables; -use parser::Spanning; -use value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; +use crate::executor::Variables; +use crate::parser::Spanning; +use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; /// A type literal in the syntax tree /// @@ -434,7 +434,7 @@ where /// Compare equality with another `InputValue` ignoring any source position information. pub fn unlocated_eq(&self, other: &Self) -> bool { - use InputValue::*; + use crate::InputValue::*; match (self, other) { (&Null, &Null) => true, @@ -533,7 +533,7 @@ impl<'a, S> VariableDefinitions<'a, S> { #[cfg(test)] mod tests { use super::InputValue; - use parser::Spanning; + use crate::parser::Spanning; #[test] fn test_input_value_fmt() { diff --git a/juniper/src/executor/look_ahead.rs b/juniper/src/executor/look_ahead.rs index 1c3e27e4..403214cf 100644 --- a/juniper/src/executor/look_ahead.rs +++ b/juniper/src/executor/look_ahead.rs @@ -1,6 +1,6 @@ -use ast::{Directive, Fragment, InputValue, Selection}; -use parser::Spanning; -use value::{ScalarRefValue, ScalarValue}; +use crate::ast::{Directive, Fragment, InputValue, Selection}; +use crate::parser::Spanning; +use crate::value::{ScalarRefValue, ScalarValue}; use std::collections::HashMap; @@ -388,25 +388,25 @@ impl<'a, S> LookAheadMethods for LookAheadSelection<'a, S> { #[cfg(test)] mod tests { use super::*; - use ast::Document; - use parser::UnlocatedParseResult; - use schema::model::SchemaType; + use crate::ast::Document; + use crate::parser::UnlocatedParseResult; + use crate::schema::model::SchemaType; use std::collections::HashMap; - use validation::test_harness::{MutationRoot, QueryRoot}; - use value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; + use crate::validation::test_harness::{MutationRoot, QueryRoot}; + use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; fn parse_document_source(q: &str) -> UnlocatedParseResult> where S: ScalarValue, for<'b> &'b S: ScalarRefValue<'b>, { - ::parse_document_source(q, &SchemaType::new::(&(), &())) + crate::parse_document_source(q, &SchemaType::new::(&(), &())) } fn extract_fragments<'a, S>(doc: &'a Document) -> HashMap<&'a str, &'a Fragment<'a, S>> { let mut fragments = HashMap::new(); for d in doc { - if let ::ast::Definition::Fragment(ref f) = *d { + if let crate::ast::Definition::Fragment(ref f) = *d { let f = &f.item; fragments.insert(f.name.item, f); } @@ -429,7 +429,7 @@ query Hero { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], @@ -483,7 +483,7 @@ query Hero { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], @@ -541,7 +541,7 @@ query Hero { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], @@ -623,7 +623,7 @@ query Hero { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], @@ -683,7 +683,7 @@ query Hero($episode: Episode) { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let mut vars = Variables::default(); vars.insert("episode".into(), InputValue::Enum("JEDI".into())); let look_ahead = LookAheadSelection::build_from_selection( @@ -790,7 +790,7 @@ fragment commonFields on Character { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], @@ -854,7 +854,7 @@ query Hero { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], @@ -912,7 +912,7 @@ query Hero { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], @@ -986,7 +986,7 @@ fragment comparisonFields on Character { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let mut vars = Variables::default(); vars.insert("id".into(), InputValue::Scalar(DefaultScalarValue::Int(42))); // This will normally be there @@ -1144,7 +1144,7 @@ query Hero { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], @@ -1293,7 +1293,7 @@ fragment heroFriendNames on Hero { .unwrap(); let fragments = extract_fragments(&docs); - if let ::ast::Definition::Operation(ref op) = docs[0] { + if let crate::ast::Definition::Operation(ref op) = docs[0] { let vars = Variables::default(); let look_ahead = LookAheadSelection::build_from_selection( &op.item.selection_set[0], diff --git a/juniper/src/executor/mod.rs b/juniper/src/executor/mod.rs index 5f6ed761..89e2e345 100644 --- a/juniper/src/executor/mod.rs +++ b/juniper/src/executor/mod.rs @@ -6,23 +6,23 @@ use std::sync::RwLock; use fnv::FnvHashMap; -use ast::{ +use crate::ast::{ Definition, Document, Fragment, FromInputValue, InputValue, OperationType, Selection, ToInputValue, Type, }; -use parser::SourcePosition; -use value::Value; -use GraphQLError; +use crate::parser::SourcePosition; +use crate::value::Value; +use crate::GraphQLError; -use schema::meta::{ +use crate::schema::meta::{ Argument, DeprecationStatus, EnumMeta, EnumValue, Field, InputObjectMeta, InterfaceMeta, ListMeta, MetaType, NullableMeta, ObjectMeta, PlaceholderMeta, ScalarMeta, UnionMeta, }; -use schema::model::{RootNode, SchemaType, TypeType}; +use crate::schema::model::{RootNode, SchemaType, TypeType}; -use types::base::GraphQLType; -use types::name::Name; -use value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue}; +use crate::types::base::GraphQLType; +use crate::types::name::Name; +use crate::value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue}; mod look_ahead; @@ -141,7 +141,7 @@ pub struct FieldError { impl From for FieldError where - S: ::value::ScalarValue, + S: crate::value::ScalarValue, { fn from(e: T) -> FieldError { FieldError { diff --git a/juniper/src/executor_tests/directives.rs b/juniper/src/executor_tests/directives.rs index 751e5cbb..bc54f783 100644 --- a/juniper/src/executor_tests/directives.rs +++ b/juniper/src/executor_tests/directives.rs @@ -1,7 +1,7 @@ -use executor::Variables; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Object, Value}; +use crate::executor::Variables; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Object, Value}; struct TestType; @@ -21,7 +21,7 @@ where { let schema = RootNode::new(TestType, EmptyMutation::<()>::new()); - let (result, errs) = ::execute(query, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(query, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/executor_tests/enums.rs b/juniper/src/executor_tests/enums.rs index ec4a2799..de548a42 100644 --- a/juniper/src/executor_tests/enums.rs +++ b/juniper/src/executor_tests/enums.rs @@ -1,11 +1,11 @@ -use ast::InputValue; -use executor::Variables; -use parser::SourcePosition; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use validation::RuleError; -use value::{DefaultScalarValue, Object, Value}; -use GraphQLError::ValidationError; +use crate::ast::InputValue; +use crate::executor::Variables; +use crate::parser::SourcePosition; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::validation::RuleError; +use crate::value::{DefaultScalarValue, Object, Value}; +use crate::GraphQLError::ValidationError; #[derive(GraphQLEnumInternal, Debug)] enum Color { @@ -31,7 +31,7 @@ where { let schema = RootNode::new(TestType, EmptyMutation::<()>::new()); - let (result, errs) = ::execute(query, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(query, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -76,7 +76,7 @@ fn does_not_accept_string_literals() { let query = r#"{ toString(color: "RED") }"#; let vars = vec![].into_iter().collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -112,7 +112,7 @@ fn does_not_accept_incorrect_enum_name_in_variables() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -132,7 +132,7 @@ fn does_not_accept_incorrect_type_in_variables() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, diff --git a/juniper/src/executor_tests/executor.rs b/juniper/src/executor_tests/executor.rs index 0049b46b..a54279d0 100644 --- a/juniper/src/executor_tests/executor.rs +++ b/juniper/src/executor_tests/executor.rs @@ -1,8 +1,8 @@ mod field_execution { - use ast::InputValue; - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; + use crate::ast::InputValue; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; struct DataType; struct DeepDataType; @@ -65,7 +65,7 @@ mod field_execution { .into_iter() .collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -132,9 +132,9 @@ mod field_execution { } mod merge_parallel_fragments { - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; struct Type; @@ -161,7 +161,7 @@ mod merge_parallel_fragments { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -205,9 +205,9 @@ mod merge_parallel_fragments { } mod merge_parallel_inline_fragments { - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; struct Type; struct Other; @@ -258,7 +258,7 @@ mod merge_parallel_inline_fragments { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -326,10 +326,10 @@ mod merge_parallel_inline_fragments { } mod threads_context_correctly { - use executor::Context; - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; + use crate::executor::Context; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; struct Schema; @@ -350,7 +350,7 @@ mod threads_context_correctly { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute( + let (result, errs) = crate::execute( doc, None, &schema, @@ -379,11 +379,11 @@ mod threads_context_correctly { mod dynamic_context_switching { use indexmap::IndexMap; - use executor::{Context, ExecutionError, FieldError, FieldResult}; - use parser::SourcePosition; - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; + use crate::executor::{Context, ExecutionError, FieldError, FieldResult}; + use crate::parser::SourcePosition; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; struct Schema; @@ -457,7 +457,7 @@ mod dynamic_context_switching { .collect(), }; - let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); assert_eq!(errs, []); @@ -513,7 +513,7 @@ mod dynamic_context_switching { .collect(), }; - let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); assert_eq!(errs, vec![]); @@ -566,7 +566,7 @@ mod dynamic_context_switching { .collect(), }; - let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); assert_eq!( errs, @@ -614,7 +614,7 @@ mod dynamic_context_switching { .collect(), }; - let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); assert_eq!( errs, @@ -674,7 +674,7 @@ mod dynamic_context_switching { .collect(), }; - let (result, errs) = ::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &ctx).expect("Execution failed"); assert_eq!(errs, []); @@ -699,11 +699,11 @@ mod dynamic_context_switching { } mod propagates_errors_to_nullable_fields { - use executor::{ExecutionError, FieldError, FieldResult, IntoFieldError}; - use parser::SourcePosition; - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::{ScalarValue, Value}; + use crate::executor::{ExecutionError, FieldError, FieldResult, IntoFieldError}; + use crate::parser::SourcePosition; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::{ScalarValue, Value}; struct Schema; struct Inner; @@ -749,7 +749,7 @@ mod propagates_errors_to_nullable_fields { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); println!("Result: {:#?}", result); @@ -775,7 +775,7 @@ mod propagates_errors_to_nullable_fields { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); println!("Result: {:#?}", result); @@ -798,7 +798,7 @@ mod propagates_errors_to_nullable_fields { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); println!("Result: {:#?}", result); @@ -821,7 +821,7 @@ mod propagates_errors_to_nullable_fields { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); println!("Result: {:#?}", result); @@ -847,7 +847,7 @@ mod propagates_errors_to_nullable_fields { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); println!("Result: {:#?}", result); @@ -870,7 +870,7 @@ mod propagates_errors_to_nullable_fields { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); println!("Result: {:#?}", result); @@ -896,7 +896,7 @@ mod propagates_errors_to_nullable_fields { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); println!("Result: {:#?}", result); @@ -919,7 +919,7 @@ mod propagates_errors_to_nullable_fields { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); println!("Result: {:#?}", result); @@ -962,10 +962,10 @@ mod propagates_errors_to_nullable_fields { } mod named_operations { - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; - use GraphQLError; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; + use crate::GraphQLError; struct Schema; @@ -980,7 +980,7 @@ mod named_operations { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -997,7 +997,7 @@ mod named_operations { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -1015,7 +1015,7 @@ mod named_operations { let vars = vec![].into_iter().collect(); let (result, errs) = - ::execute(doc, Some("OtherExample"), &schema, &vars, &()).expect("Execution failed"); + crate::execute(doc, Some("OtherExample"), &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -1032,7 +1032,7 @@ mod named_operations { let vars = vec![].into_iter().collect(); - let err = ::execute(doc, None, &schema, &vars, &()).unwrap_err(); + let err = crate::execute(doc, None, &schema, &vars, &()).unwrap_err(); assert_eq!(err, GraphQLError::MultipleOperationsProvided); } @@ -1044,7 +1044,7 @@ mod named_operations { let vars = vec![].into_iter().collect(); - let err = ::execute(doc, Some("UnknownExample"), &schema, &vars, &()).unwrap_err(); + let err = crate::execute(doc, Some("UnknownExample"), &schema, &vars, &()).unwrap_err(); assert_eq!(err, GraphQLError::UnknownOperationName); } diff --git a/juniper/src/executor_tests/interfaces_unions.rs b/juniper/src/executor_tests/interfaces_unions.rs index 11a64870..ebeb10bf 100644 --- a/juniper/src/executor_tests/interfaces_unions.rs +++ b/juniper/src/executor_tests/interfaces_unions.rs @@ -1,7 +1,7 @@ mod interface { - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; trait Pet { fn name(&self) -> &str; @@ -107,7 +107,7 @@ mod interface { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -145,9 +145,9 @@ mod interface { } mod union { - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; trait Pet { fn as_dog(&self) -> Option<&Dog> { @@ -241,7 +241,7 @@ mod union { let vars = vec![].into_iter().collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/executor_tests/introspection/enums.rs b/juniper/src/executor_tests/introspection/enums.rs index d1a267d4..e3373d47 100644 --- a/juniper/src/executor_tests/introspection/enums.rs +++ b/juniper/src/executor_tests/introspection/enums.rs @@ -1,7 +1,7 @@ -use executor::Variables; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Object, Value}; +use crate::executor::Variables; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Object, Value}; /* @@ -78,7 +78,7 @@ where let schema = RootNode::new(Root {}, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/executor_tests/introspection/input_object.rs b/juniper/src/executor_tests/introspection/input_object.rs index f87539af..4d9f00f2 100644 --- a/juniper/src/executor_tests/introspection/input_object.rs +++ b/juniper/src/executor_tests/introspection/input_object.rs @@ -1,8 +1,8 @@ -use ast::{FromInputValue, InputValue}; -use executor::Variables; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Object, Value}; +use crate::ast::{FromInputValue, InputValue}; +use crate::executor::Variables; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Object, Value}; struct Root; @@ -102,7 +102,7 @@ where let schema = RootNode::new(Root {}, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/executor_tests/introspection/mod.rs b/juniper/src/executor_tests/introspection/mod.rs index bc1d1a18..3616905a 100644 --- a/juniper/src/executor_tests/introspection/mod.rs +++ b/juniper/src/executor_tests/introspection/mod.rs @@ -5,10 +5,10 @@ mod input_object; #[allow(unused_imports)] use self::input_object::{NamedPublic, NamedPublicWithDescription}; -use executor::Variables; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{ParseScalarResult, ParseScalarValue, Value}; +use crate::executor::Variables; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{ParseScalarResult, ParseScalarValue, Value}; #[derive(GraphQLEnumInternal)] #[graphql(name = "SampleEnum")] @@ -78,7 +78,7 @@ fn test_execution() { let schema = RootNode::new(Root, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); @@ -122,7 +122,7 @@ fn enum_introspection() { let schema = RootNode::new(Root, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); @@ -231,7 +231,7 @@ fn interface_introspection() { let schema = RootNode::new(Root, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); @@ -378,7 +378,7 @@ fn object_introspection() { let schema = RootNode::new(Root, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); @@ -585,7 +585,7 @@ fn scalar_introspection() { let schema = RootNode::new(Root, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/executor_tests/variables.rs b/juniper/src/executor_tests/variables.rs index f17b1826..4b058f0a 100644 --- a/juniper/src/executor_tests/variables.rs +++ b/juniper/src/executor_tests/variables.rs @@ -1,11 +1,11 @@ -use ast::InputValue; -use executor::Variables; -use parser::SourcePosition; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use validation::RuleError; -use value::{DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, Value}; -use GraphQLError::ValidationError; +use crate::ast::InputValue; +use crate::executor::Variables; +use crate::parser::SourcePosition; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::validation::RuleError; +use crate::value::{DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, Value}; +use crate::GraphQLError::ValidationError; #[derive(Debug)] struct TestComplexScalar; @@ -120,7 +120,7 @@ where { let schema = RootNode::new(TestType, EmptyMutation::<()>::new()); - let (result, errs) = ::execute(query, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(query, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); @@ -271,7 +271,7 @@ fn variable_error_on_nested_non_null() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -291,7 +291,7 @@ fn variable_error_on_incorrect_type() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!(error, ValidationError(vec![ RuleError::new( @@ -320,7 +320,7 @@ fn variable_error_on_omit_non_null() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -351,7 +351,7 @@ fn variable_multiple_errors_with_nesting() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!(error, ValidationError(vec![ RuleError::new( @@ -386,7 +386,7 @@ fn variable_error_on_additional_field() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -488,7 +488,7 @@ fn does_not_allow_non_nullable_input_to_be_omitted_in_variable() { let query = r#"query q($value: String!) { fieldWithNonNullableStringInput(input: $value) }"#; let vars = vec![].into_iter().collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -508,7 +508,7 @@ fn does_not_allow_non_nullable_input_to_be_set_to_null_in_variable() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -615,7 +615,7 @@ fn does_not_allow_non_null_lists_to_be_null() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -718,7 +718,7 @@ fn does_not_allow_lists_of_non_null_to_contain_null() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!(error, ValidationError(vec![ RuleError::new( @@ -744,7 +744,7 @@ fn does_not_allow_non_null_lists_of_non_null_to_contain_null() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!(error, ValidationError(vec![ RuleError::new( @@ -763,7 +763,7 @@ fn does_not_allow_non_null_lists_of_non_null_to_be_null() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -805,7 +805,7 @@ fn does_not_allow_invalid_types_to_be_used_as_values() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!(error, ValidationError(vec![ RuleError::new( @@ -827,7 +827,7 @@ fn does_not_allow_unknown_types_to_be_used_as_values() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!(error, ValidationError(vec![ RuleError::new( @@ -940,7 +940,7 @@ fn does_not_allow_missing_required_field() { let query = r#"{ exampleInput(arg: {a: "abc"}) }"#; let vars = vec![].into_iter().collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -958,7 +958,7 @@ fn does_not_allow_null_in_required_field() { let query = r#"{ exampleInput(arg: {a: "abc", b: null}) }"#; let vars = vec![].into_iter().collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -976,7 +976,7 @@ fn does_not_allow_missing_variable_for_required_field() { let query = r#"query q($var: Int!) { exampleInput(arg: {b: $var}) }"#; let vars = vec![].into_iter().collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -996,7 +996,7 @@ fn does_not_allow_null_variable_for_required_field() { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -1095,7 +1095,7 @@ mod integers { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -1115,7 +1115,7 @@ mod integers { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, @@ -1171,7 +1171,7 @@ mod floats { .into_iter() .collect(); - let error = ::execute(query, None, &schema, &vars, &()).unwrap_err(); + let error = crate::execute(query, None, &schema, &vars, &()).unwrap_err(); assert_eq!( error, diff --git a/juniper/src/http/mod.rs b/juniper/src/http/mod.rs index 0759872a..aff4051e 100644 --- a/juniper/src/http/mod.rs +++ b/juniper/src/http/mod.rs @@ -6,10 +6,10 @@ pub mod playground; use serde::de::Deserialize; use serde::ser::{self, Serialize, SerializeMap}; -use ast::InputValue; -use executor::ExecutionError; -use value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; -use {FieldError, GraphQLError, GraphQLType, RootNode, Value, Variables}; +use crate::ast::InputValue; +use crate::executor::ExecutionError; +use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; +use crate::{FieldError, GraphQLError, GraphQLType, RootNode, Value, Variables}; /// The expected structure of the decoded JSON document for either POST or GET requests. /// @@ -80,7 +80,7 @@ where MutationT: GraphQLType, for<'b> &'b S: ScalarRefValue<'b>, { - GraphQLResponse(::execute( + GraphQLResponse(crate::execute( &self.query, self.operation_name(), root_node, diff --git a/juniper/src/integrations/chrono.rs b/juniper/src/integrations/chrono.rs index 67a65ae6..aaa7553e 100644 --- a/juniper/src/integrations/chrono.rs +++ b/juniper/src/integrations/chrono.rs @@ -15,9 +15,9 @@ */ use chrono::prelude::*; -use parser::{ParseError, ScalarToken, Token}; -use value::{ParseScalarResult, ParseScalarValue}; -use Value; +use crate::parser::{ParseError, ScalarToken, Token}; +use crate::value::{ParseScalarResult, ParseScalarValue}; +use crate::Value; #[doc(hidden)] pub static RFC3339_FORMAT: &'static str = "%Y-%m-%dT%H:%M:%S%.f%:z"; @@ -90,8 +90,8 @@ graphql_scalar!(NaiveDate where Scalar = { } }); -/// JSON numbers (i.e. IEEE doubles) are not precise enough for nanosecond -/// datetimes. Values will be truncated to microsecond resolution. +// JSON numbers (i.e. IEEE doubles) are not precise enough for nanosecond +// datetimes. Values will be truncated to microsecond resolution. graphql_scalar!(NaiveDateTime where Scalar = { description: "NaiveDateTime" @@ -112,12 +112,12 @@ graphql_scalar!(NaiveDateTime where Scalar = { #[cfg(test)] mod test { use chrono::prelude::*; - use value::DefaultScalarValue; + use crate::{value::DefaultScalarValue, InputValue}; fn datetime_fixedoffset_test(raw: &'static str) { - let input: ::InputValue = ::InputValue::scalar(raw.to_string()); + let input: crate::InputValue = InputValue::scalar(raw.to_string()); - let parsed: DateTime = ::FromInputValue::from_input_value(&input).unwrap(); + let parsed: DateTime = crate::FromInputValue::from_input_value(&input).unwrap(); let expected = DateTime::parse_from_rfc3339(raw).unwrap(); assert_eq!(parsed, expected); @@ -139,9 +139,9 @@ mod test { } fn datetime_utc_test(raw: &'static str) { - let input: ::InputValue = ::InputValue::scalar(raw.to_string()); + let input: crate::InputValue = InputValue::scalar(raw.to_string()); - let parsed: DateTime = ::FromInputValue::from_input_value(&input).unwrap(); + let parsed: DateTime = crate::FromInputValue::from_input_value(&input).unwrap(); let expected = DateTime::parse_from_rfc3339(raw) .unwrap() .with_timezone(&Utc); @@ -166,13 +166,13 @@ mod test { #[test] fn naivedate_from_input_value() { - let input: ::InputValue = - ::InputValue::scalar("1996-12-19".to_string()); + let input: crate::InputValue = + InputValue::scalar("1996-12-19".to_string()); let y = 1996; let m = 12; let d = 19; - let parsed: NaiveDate = ::FromInputValue::from_input_value(&input).unwrap(); + let parsed: NaiveDate = crate::FromInputValue::from_input_value(&input).unwrap(); let expected = NaiveDate::from_ymd(y, m, d); assert_eq!(parsed, expected); @@ -185,9 +185,9 @@ mod test { #[test] fn naivedatetime_from_input_value() { let raw = 1_000_000_000_f64; - let input: ::InputValue = ::InputValue::scalar(raw); + let input: InputValue = InputValue::scalar(raw); - let parsed: NaiveDateTime = ::FromInputValue::from_input_value(&input).unwrap(); + let parsed: NaiveDateTime = crate::FromInputValue::from_input_value(&input).unwrap(); let expected = NaiveDateTime::from_timestamp_opt(raw as i64, 0).unwrap(); assert_eq!(parsed, expected); @@ -200,10 +200,10 @@ mod integration_test { use chrono::prelude::*; use chrono::Utc; - use executor::Variables; - use schema::model::RootNode; - use types::scalars::EmptyMutation; - use value::Value; + use crate::executor::Variables; + use crate::schema::model::RootNode; + use crate::types::scalars::EmptyMutation; + use crate::value::Value; #[test] fn test_serialization() { @@ -235,7 +235,7 @@ mod integration_test { let schema = RootNode::new(Root, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/integrations/serde.rs b/juniper/src/integrations/serde.rs index 97ded1cd..8a53622e 100644 --- a/juniper/src/integrations/serde.rs +++ b/juniper/src/integrations/serde.rs @@ -4,11 +4,11 @@ use serde::{de, ser}; use std::fmt; -use ast::InputValue; -use executor::ExecutionError; -use parser::{ParseError, SourcePosition, Spanning}; -use validation::RuleError; -use {GraphQLError, Object, ScalarValue, Value}; +use crate::ast::InputValue; +use crate::executor::ExecutionError; +use crate::parser::{ParseError, SourcePosition, Spanning}; +use crate::validation::RuleError; +use crate::{GraphQLError, Object, ScalarValue, Value}; #[derive(Serialize)] struct SerializeHelper { @@ -397,11 +397,11 @@ where #[cfg(test)] mod tests { use super::{ExecutionError, GraphQLError}; - use ast::InputValue; + use crate::ast::InputValue; use serde_json::from_str; use serde_json::to_string; - use value::{DefaultScalarValue, Object}; - use {FieldError, Value}; + use crate::value::{DefaultScalarValue, Object}; + use crate::{FieldError, Value}; #[test] fn int() { diff --git a/juniper/src/integrations/url.rs b/juniper/src/integrations/url.rs index c1c00f52..422a6d48 100644 --- a/juniper/src/integrations/url.rs +++ b/juniper/src/integrations/url.rs @@ -1,7 +1,7 @@ use url::Url; -use value::{ParseScalarResult, ParseScalarValue}; -use Value; +use crate::value::{ParseScalarResult, ParseScalarValue}; +use crate::Value; graphql_scalar!(Url where Scalar = { description: "Url" @@ -23,13 +23,14 @@ graphql_scalar!(Url where Scalar = { #[cfg(test)] mod test { use url::Url; + use crate::InputValue; #[test] fn url_from_input_value() { let raw = "https://example.net/"; - let input: ::InputValue = ::InputValue::scalar(raw.to_string()); + let input: InputValue = InputValue::scalar(raw.to_string()); - let parsed: Url = ::FromInputValue::from_input_value(&input).unwrap(); + let parsed: Url = crate::FromInputValue::from_input_value(&input).unwrap(); let url = Url::parse(raw).unwrap(); assert_eq!(parsed, url); diff --git a/juniper/src/integrations/uuid.rs b/juniper/src/integrations/uuid.rs index 52cf78c2..5a515f8b 100644 --- a/juniper/src/integrations/uuid.rs +++ b/juniper/src/integrations/uuid.rs @@ -1,8 +1,10 @@ use uuid::Uuid; -use parser::{ParseError, ScalarToken, Token}; -use value::ParseScalarResult; -use Value; +use crate::{ + parser::{ParseError, ScalarToken, Token}, + value::ParseScalarResult, + Value, +}; graphql_scalar!(Uuid where Scalar = { description: "Uuid" @@ -28,14 +30,14 @@ graphql_scalar!(Uuid where Scalar = { #[cfg(test)] mod test { use uuid::Uuid; - use value::DefaultScalarValue; + use crate::{value::DefaultScalarValue, InputValue}; #[test] fn uuid_from_input_value() { let raw = "123e4567-e89b-12d3-a456-426655440000"; - let input: ::InputValue = ::InputValue::scalar(raw.to_string()); + let input: InputValue = InputValue::scalar(raw.to_string()); - let parsed: Uuid = ::FromInputValue::from_input_value(&input).unwrap(); + let parsed: Uuid = crate::FromInputValue::from_input_value(&input).unwrap(); let id = Uuid::parse_str(raw).unwrap(); assert_eq!(parsed, id); diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs index d909625a..ad676772 100644 --- a/juniper/src/lib.rs +++ b/juniper/src/lib.rs @@ -138,7 +138,7 @@ mod validation; pub mod http; pub mod integrations; // TODO: remove this alias export in 0.10. (breaking change) -pub use http::graphiql; +pub use crate::http::graphiql; #[cfg(all(test, not(feature = "expose-test-schema")))] mod tests; @@ -149,28 +149,28 @@ pub mod tests; mod executor_tests; // Needs to be public because macros use it. -pub use util::to_camel_case; +pub use crate::util::to_camel_case; -use executor::execute_validated_query; -use introspection::{INTROSPECTION_QUERY, INTROSPECTION_QUERY_WITHOUT_DESCRIPTIONS}; -use parser::{parse_document_source, ParseError, Spanning}; -use validation::{validate_input_values, visit_all_rules, ValidatorContext}; +use crate::executor::execute_validated_query; +use crate::introspection::{INTROSPECTION_QUERY, INTROSPECTION_QUERY_WITHOUT_DESCRIPTIONS}; +use crate::parser::{parse_document_source, ParseError, Spanning}; +use crate::validation::{validate_input_values, visit_all_rules, ValidatorContext}; -pub use ast::{FromInputValue, InputValue, Selection, ToInputValue, Type}; -pub use executor::{ +pub use crate::ast::{FromInputValue, InputValue, Selection, ToInputValue, Type}; +pub use crate::executor::{ Applies, LookAheadArgument, LookAheadMethods, LookAheadSelection, LookAheadValue, }; -pub use executor::{ +pub use crate::executor::{ Context, ExecutionError, ExecutionResult, Executor, FieldError, FieldResult, FromContext, IntoFieldError, IntoResolvable, Registry, Variables, }; -pub use introspection::IntrospectionFormat; -pub use schema::meta; -pub use schema::model::RootNode; -pub use types::base::{Arguments, GraphQLType, TypeKind}; -pub use types::scalars::{EmptyMutation, ID}; -pub use validation::RuleError; -pub use value::{ +pub use crate::introspection::IntrospectionFormat; +pub use crate::schema::meta; +pub use crate::schema::model::RootNode; +pub use crate::types::base::{Arguments, GraphQLType, TypeKind}; +pub use crate::types::scalars::{EmptyMutation, ID}; +pub use crate::validation::RuleError; +pub use crate::value::{ DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, ScalarRefValue, ScalarValue, Value, }; diff --git a/juniper/src/macros/tests/args.rs b/juniper/src/macros/tests/args.rs index 9a3420cf..0f19142e 100644 --- a/juniper/src/macros/tests/args.rs +++ b/juniper/src/macros/tests/args.rs @@ -1,7 +1,7 @@ -use executor::Variables; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Value}; +use crate::executor::Variables; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Value}; struct Root; @@ -109,7 +109,7 @@ where let schema = RootNode::new(Root {}, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/macros/tests/field.rs b/juniper/src/macros/tests/field.rs index 17e80bde..9002769c 100644 --- a/juniper/src/macros/tests/field.rs +++ b/juniper/src/macros/tests/field.rs @@ -1,8 +1,8 @@ -use ast::InputValue; -use executor::FieldResult; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Object, Value}; +use crate::ast::InputValue; +use crate::executor::FieldResult; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Object, Value}; struct Interface; #[derive(Debug)] @@ -124,7 +124,7 @@ where .into_iter() .collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/macros/tests/interface.rs b/juniper/src/macros/tests/interface.rs index ef4b1dc1..b2b3148f 100644 --- a/juniper/src/macros/tests/interface.rs +++ b/juniper/src/macros/tests/interface.rs @@ -1,9 +1,9 @@ use std::marker::PhantomData; -use ast::InputValue; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Object, Value}; +use crate::ast::InputValue; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Object, Value}; /* @@ -147,7 +147,7 @@ where .into_iter() .collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/macros/tests/object.rs b/juniper/src/macros/tests/object.rs index f31300e9..fcc6a527 100644 --- a/juniper/src/macros/tests/object.rs +++ b/juniper/src/macros/tests/object.rs @@ -1,10 +1,10 @@ use std::marker::PhantomData; -use ast::InputValue; -use executor::{Context, FieldResult}; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Object, Value}; +use crate::ast::InputValue; +use crate::executor::{Context, FieldResult}; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Object, Value}; /* @@ -174,7 +174,7 @@ where .collect(); let (result, errs) = - ::execute(doc, None, &schema, &vars, &InnerContext).expect("Execution failed"); + crate::execute(doc, None, &schema, &vars, &InnerContext).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/macros/tests/scalar.rs b/juniper/src/macros/tests/scalar.rs index fbc29f87..a823f992 100644 --- a/juniper/src/macros/tests/scalar.rs +++ b/juniper/src/macros/tests/scalar.rs @@ -1,7 +1,7 @@ -use executor::Variables; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, Value}; +use crate::executor::Variables; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Object, ParseScalarResult, ParseScalarValue, Value}; struct DefaultName(i32); struct OtherOrder(i32); @@ -92,7 +92,7 @@ where let schema = RootNode::new(Root {}, EmptyMutation::<()>::new()); let (result, errs) = - ::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); + crate::execute(doc, None, &schema, &Variables::new(), &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/macros/tests/union.rs b/juniper/src/macros/tests/union.rs index fa0db5b7..da8e9086 100644 --- a/juniper/src/macros/tests/union.rs +++ b/juniper/src/macros/tests/union.rs @@ -1,9 +1,9 @@ use std::marker::PhantomData; -use ast::InputValue; -use schema::model::RootNode; -use types::scalars::EmptyMutation; -use value::{DefaultScalarValue, Object, Value}; +use crate::ast::InputValue; +use crate::schema::model::RootNode; +use crate::types::scalars::EmptyMutation; +use crate::value::{DefaultScalarValue, Object, Value}; /* @@ -128,7 +128,7 @@ where .into_iter() .collect(); - let (result, errs) = ::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); + let (result, errs) = crate::execute(doc, None, &schema, &vars, &()).expect("Execution failed"); assert_eq!(errs, []); diff --git a/juniper/src/parser/document.rs b/juniper/src/parser/document.rs index 4a0bd94f..00308558 100644 --- a/juniper/src/parser/document.rs +++ b/juniper/src/parser/document.rs @@ -1,18 +1,18 @@ use std::borrow::Cow; -use ast::{ +use crate::ast::{ Arguments, Definition, Directive, Document, Field, Fragment, FragmentSpread, InlineFragment, InputValue, Operation, OperationType, Selection, Type, VariableDefinition, VariableDefinitions, }; -use parser::value::parse_value_literal; -use parser::{ +use crate::parser::value::parse_value_literal; +use crate::parser::{ Lexer, OptionParseResult, ParseError, ParseResult, Parser, Spanning, Token, UnlocatedParseResult, }; -use schema::meta::{Argument, Field as MetaField}; -use schema::model::SchemaType; -use value::ScalarValue; +use crate::schema::meta::{Argument, Field as MetaField}; +use crate::schema::model::SchemaType; +use crate::value::ScalarValue; #[doc(hidden)] pub fn parse_document_source<'a, 'b, S>( diff --git a/juniper/src/parser/lexer.rs b/juniper/src/parser/lexer.rs index bf4d99a1..4873c258 100644 --- a/juniper/src/parser/lexer.rs +++ b/juniper/src/parser/lexer.rs @@ -4,7 +4,7 @@ use std::iter::{Iterator, Peekable}; use std::result::Result; use std::str::CharIndices; -use parser::{SourcePosition, Spanning}; +use crate::parser::{SourcePosition, Spanning}; #[doc(hidden)] #[derive(Debug)] diff --git a/juniper/src/parser/parser.rs b/juniper/src/parser/parser.rs index 01f9bd8d..764d6915 100644 --- a/juniper/src/parser/parser.rs +++ b/juniper/src/parser/parser.rs @@ -1,7 +1,7 @@ use std::fmt; use std::result::Result; -use parser::{Lexer, LexerError, Spanning, Token}; +use crate::parser::{Lexer, LexerError, Spanning, Token}; /// Error while parsing a GraphQL query #[derive(Debug, PartialEq)] diff --git a/juniper/src/parser/tests/document.rs b/juniper/src/parser/tests/document.rs index 06bebeca..f4c4c1a7 100644 --- a/juniper/src/parser/tests/document.rs +++ b/juniper/src/parser/tests/document.rs @@ -1,11 +1,11 @@ -use ast::{ +use crate::ast::{ Arguments, Definition, Document, Field, InputValue, Operation, OperationType, Selection, }; -use parser::document::parse_document_source; -use parser::{ParseError, SourcePosition, Spanning, Token}; -use schema::model::SchemaType; -use validation::test_harness::{MutationRoot, QueryRoot}; -use value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; +use crate::parser::document::parse_document_source; +use crate::parser::{ParseError, SourcePosition, Spanning, Token}; +use crate::schema::model::SchemaType; +use crate::validation::test_harness::{MutationRoot, QueryRoot}; +use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; fn parse_document(s: &str) -> Document where diff --git a/juniper/src/parser/tests/lexer.rs b/juniper/src/parser/tests/lexer.rs index 369aa112..39f3b9a6 100644 --- a/juniper/src/parser/tests/lexer.rs +++ b/juniper/src/parser/tests/lexer.rs @@ -1,4 +1,4 @@ -use parser::{Lexer, LexerError, ScalarToken, SourcePosition, Spanning, Token}; +use crate::parser::{Lexer, LexerError, ScalarToken, SourcePosition, Spanning, Token}; fn tokenize_to_vec<'a>(s: &'a str) -> Vec>> { let mut tokens = Vec::new(); diff --git a/juniper/src/parser/tests/value.rs b/juniper/src/parser/tests/value.rs index 619f8bf3..fed1c316 100644 --- a/juniper/src/parser/tests/value.rs +++ b/juniper/src/parser/tests/value.rs @@ -1,13 +1,13 @@ use indexmap::IndexMap; -use ast::{FromInputValue, InputValue, Type}; -use parser::value::parse_value_literal; -use parser::{Lexer, Parser, SourcePosition, Spanning}; -use value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue}; +use crate::ast::{FromInputValue, InputValue, Type}; +use crate::parser::value::parse_value_literal; +use crate::parser::{Lexer, Parser, SourcePosition, Spanning}; +use crate::value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue}; -use schema::meta::{Argument, EnumMeta, EnumValue, InputObjectMeta, MetaType, ScalarMeta}; -use schema::model::SchemaType; -use types::scalars::EmptyMutation; +use crate::schema::meta::{Argument, EnumMeta, EnumValue, InputObjectMeta, MetaType, ScalarMeta}; +use crate::schema::model::SchemaType; +use crate::types::scalars::EmptyMutation; #[derive(GraphQLEnumInternal)] enum Enum { diff --git a/juniper/src/parser/value.rs b/juniper/src/parser/value.rs index a1d7416d..71c8d138 100644 --- a/juniper/src/parser/value.rs +++ b/juniper/src/parser/value.rs @@ -1,9 +1,9 @@ -use ast::InputValue; +use crate::ast::InputValue; -use parser::{ParseError, ParseResult, Parser, ScalarToken, SourcePosition, Spanning, Token}; -use schema::meta::{InputObjectMeta, MetaType}; -use schema::model::SchemaType; -use value::ScalarValue; +use crate::parser::{ParseError, ParseResult, Parser, ScalarToken, SourcePosition, Spanning, Token}; +use crate::schema::meta::{InputObjectMeta, MetaType}; +use crate::schema::model::SchemaType; +use crate::value::ScalarValue; pub fn parse_value_literal<'a, 'b, S>( parser: &mut Parser<'a>, diff --git a/juniper/src/schema/meta.rs b/juniper/src/schema/meta.rs index a294e996..3aa19c72 100644 --- a/juniper/src/schema/meta.rs +++ b/juniper/src/schema/meta.rs @@ -3,11 +3,11 @@ use std::borrow::Cow; use std::fmt; -use ast::{FromInputValue, InputValue, Type}; -use parser::{ParseError, ScalarToken}; -use schema::model::SchemaType; -use types::base::TypeKind; -use value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue}; +use crate::ast::{FromInputValue, InputValue, Type}; +use crate::parser::{ParseError, ScalarToken}; +use crate::schema::model::SchemaType; +use crate::types::base::TypeKind; +use crate::value::{DefaultScalarValue, ParseScalarValue, ScalarRefValue, ScalarValue}; /// Whether an item is deprecated, with context. #[derive(Debug, PartialEq, Hash, Clone)] diff --git a/juniper/src/schema/model.rs b/juniper/src/schema/model.rs index acd47cff..d63bd9f7 100644 --- a/juniper/src/schema/model.rs +++ b/juniper/src/schema/model.rs @@ -2,12 +2,12 @@ use std::fmt; use fnv::FnvHashMap; -use ast::Type; -use executor::{Context, Registry}; -use schema::meta::{Argument, InterfaceMeta, MetaType, ObjectMeta, PlaceholderMeta, UnionMeta}; -use types::base::GraphQLType; -use types::name::Name; -use value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; +use crate::ast::Type; +use crate::executor::{Context, Registry}; +use crate::schema::meta::{Argument, InterfaceMeta, MetaType, ObjectMeta, PlaceholderMeta, UnionMeta}; +use crate::types::base::GraphQLType; +use crate::types::name::Name; +use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; /// Root query node of a schema /// @@ -319,7 +319,7 @@ impl<'a, S> SchemaType<'a, S> { } pub fn is_subtype<'b>(&self, sub_type: &Type<'b>, super_type: &Type<'b>) -> bool { - use ast::Type::*; + use crate::ast::Type::*; if super_type == sub_type { return true; diff --git a/juniper/src/schema/schema.rs b/juniper/src/schema/schema.rs index a2bac671..a7073938 100644 --- a/juniper/src/schema/schema.rs +++ b/juniper/src/schema/schema.rs @@ -1,13 +1,13 @@ -use ast::Selection; -use executor::{ExecutionResult, Executor, Registry}; -use types::base::{Arguments, GraphQLType, TypeKind}; -use value::{ScalarRefValue, ScalarValue, Value}; +use crate::ast::Selection; +use crate::executor::{ExecutionResult, Executor, Registry}; +use crate::types::base::{Arguments, GraphQLType, TypeKind}; +use crate::value::{ScalarRefValue, ScalarValue, Value}; -use schema::meta::{ +use crate::schema::meta::{ Argument, EnumMeta, EnumValue, Field, InputObjectMeta, InterfaceMeta, MetaType, ObjectMeta, UnionMeta, }; -use schema::model::{DirectiveLocation, DirectiveType, RootNode, SchemaType, TypeType}; +use crate::schema::model::{DirectiveLocation, DirectiveType, RootNode, SchemaType, TypeType}; impl<'a, CtxT, S, QueryT, MutationT> GraphQLType for RootNode<'a, QueryT, MutationT, S> where @@ -58,8 +58,8 @@ where selection_set: Option<&[Selection]>, executor: &Executor, ) -> Value { - use types::base::resolve_selection_set_into; - use value::Object; + use crate::types::base::resolve_selection_set_into; + use crate::value::Object; if let Some(selection_set) = selection_set { let mut result = Object::with_capacity(selection_set.len()); if resolve_selection_set_into(self, info, selection_set, executor, &mut result) { diff --git a/juniper/src/tests/introspection_tests.rs b/juniper/src/tests/introspection_tests.rs index 1a9bc3d6..0bd0eb6c 100644 --- a/juniper/src/tests/introspection_tests.rs +++ b/juniper/src/tests/introspection_tests.rs @@ -1,11 +1,11 @@ use std::collections::HashSet; use super::schema_introspection::*; -use executor::Variables; -use introspection::IntrospectionFormat; -use schema::model::RootNode; -use tests::model::Database; -use types::scalars::EmptyMutation; +use crate::executor::Variables; +use crate::introspection::IntrospectionFormat; +use crate::schema::model::RootNode; +use crate::tests::model::Database; +use crate::types::scalars::EmptyMutation; #[test] fn test_introspection_query_type_name() { @@ -21,7 +21,7 @@ fn test_introspection_query_type_name() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( graphql_value!({ "__schema": { @@ -48,7 +48,7 @@ fn test_introspection_type_name() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( graphql_value!({ "__type": { @@ -74,7 +74,7 @@ fn test_introspection_specific_object_type_name_and_kind() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( graphql_value!({ "__type": { @@ -101,7 +101,7 @@ fn test_introspection_specific_interface_type_name_and_kind() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( graphql_value!({ "__type": { @@ -128,7 +128,7 @@ fn test_introspection_documentation() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( graphql_value!({ "__type": { @@ -201,7 +201,7 @@ fn test_introspection_possible_types() { let database = Database::new(); let schema = RootNode::new(&database, EmptyMutation::::new()); - let result = ::execute(doc, None, &schema, &Variables::new(), &database); + let result = crate::execute(doc, None, &schema, &Variables::new(), &database); let (result, errors) = result.ok().expect("Query returned error"); diff --git a/juniper/src/tests/query_tests.rs b/juniper/src/tests/query_tests.rs index 8f14e05e..3646c3e1 100644 --- a/juniper/src/tests/query_tests.rs +++ b/juniper/src/tests/query_tests.rs @@ -1,9 +1,9 @@ -use ast::InputValue; -use executor::Variables; -use schema::model::RootNode; -use tests::model::Database; -use types::scalars::EmptyMutation; -use value::Value; +use crate::ast::InputValue; +use crate::executor::Variables; +use crate::schema::model::RootNode; +use crate::tests::model::Database; +use crate::types::scalars::EmptyMutation; +use crate::value::Value; #[test] fn test_hero_name() { @@ -17,7 +17,7 @@ fn test_hero_name() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -45,7 +45,7 @@ fn test_hero_field_order() { } }"#; assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -74,7 +74,7 @@ fn test_hero_field_order() { } }"#; assert_eq!( - ::execute(doc_reversed, None, &schema, &Variables::new(), &database), + crate::execute(doc_reversed, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -112,7 +112,7 @@ fn test_hero_name_and_friends() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -174,7 +174,7 @@ fn test_hero_name_and_friends_and_friends_of_friends() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -335,7 +335,7 @@ fn test_query_name() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -361,7 +361,7 @@ fn test_query_alias_single() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -391,7 +391,7 @@ fn test_query_alias_multiple() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![ @@ -436,7 +436,7 @@ fn test_query_alias_multiple_with_fragment() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![ @@ -482,7 +482,7 @@ fn test_query_name_variable() { .collect(); assert_eq!( - ::execute(doc, None, &schema, &vars, &database), + crate::execute(doc, None, &schema, &vars, &database), Ok(( Value::object( vec![( @@ -512,7 +512,7 @@ fn test_query_name_invalid_variable() { .collect(); assert_eq!( - ::execute(doc, None, &schema, &vars, &database), + crate::execute(doc, None, &schema, &vars, &database), Ok(( Value::object(vec![("human", Value::null())].into_iter().collect()), vec![] @@ -527,7 +527,7 @@ fn test_query_friends_names() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -584,7 +584,7 @@ fn test_query_inline_fragments_droid() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -621,7 +621,7 @@ fn test_query_inline_fragments_human() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( @@ -655,7 +655,7 @@ fn test_object_typename() { let schema = RootNode::new(&database, EmptyMutation::::new()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &database), + crate::execute(doc, None, &schema, &Variables::new(), &database), Ok(( Value::object( vec![( diff --git a/juniper/src/tests/schema.rs b/juniper/src/tests/schema.rs index a3735986..fc8890bc 100644 --- a/juniper/src/tests/schema.rs +++ b/juniper/src/tests/schema.rs @@ -1,5 +1,5 @@ -use executor::Context; -use tests::model::{Character, Database, Droid, Episode, Human}; +use crate::executor::Context; +use crate::tests::model::{Character, Database, Droid, Episode, Human}; impl Context for Database {} diff --git a/juniper/src/tests/type_info_tests.rs b/juniper/src/tests/type_info_tests.rs index 9fc7e45f..7b2bbdae 100644 --- a/juniper/src/tests/type_info_tests.rs +++ b/juniper/src/tests/type_info_tests.rs @@ -1,11 +1,11 @@ use indexmap::IndexMap; -use executor::{ExecutionResult, Executor, Registry, Variables}; -use schema::meta::MetaType; -use schema::model::RootNode; -use types::base::{Arguments, GraphQLType}; -use types::scalars::EmptyMutation; -use value::{ScalarRefValue, ScalarValue, Value}; +use crate::executor::{ExecutionResult, Executor, Registry, Variables}; +use crate::schema::meta::MetaType; +use crate::schema::model::RootNode; +use crate::types::base::{Arguments, GraphQLType}; +use crate::types::scalars::EmptyMutation; +use crate::value::{ScalarRefValue, ScalarValue, Value}; pub struct NodeTypeInfo { name: String, @@ -75,7 +75,7 @@ fn test_node() { let schema: RootNode<_, _> = RootNode::new_with_info(node, EmptyMutation::new(), node_info, ()); assert_eq!( - ::execute(doc, None, &schema, &Variables::new(), &()), + crate::execute(doc, None, &schema, &Variables::new(), &()), Ok(( Value::object( vec![ diff --git a/juniper/src/types/base.rs b/juniper/src/types/base.rs index f54149fd..84e97069 100644 --- a/juniper/src/types/base.rs +++ b/juniper/src/types/base.rs @@ -1,12 +1,12 @@ use indexmap::IndexMap; -use ast::{Directive, FromInputValue, InputValue, Selection}; -use executor::Variables; -use value::{DefaultScalarValue, Object, ScalarRefValue, ScalarValue, Value}; +use crate::ast::{Directive, FromInputValue, InputValue, Selection}; +use crate::executor::Variables; +use crate::value::{DefaultScalarValue, Object, ScalarRefValue, ScalarValue, Value}; -use executor::{ExecutionResult, Executor, Registry}; -use parser::Spanning; -use schema::meta::{Argument, MetaType}; +use crate::executor::{ExecutionResult, Executor, Registry}; +use crate::parser::Spanning; +use crate::schema::meta::{Argument, MetaType}; /// GraphQL type kind /// diff --git a/juniper/src/types/containers.rs b/juniper/src/types/containers.rs index 354f4533..913e8e4b 100644 --- a/juniper/src/types/containers.rs +++ b/juniper/src/types/containers.rs @@ -1,9 +1,9 @@ -use ast::{FromInputValue, InputValue, Selection, ToInputValue}; -use schema::meta::MetaType; -use value::{ScalarRefValue, ScalarValue, Value}; +use crate::ast::{FromInputValue, InputValue, Selection, ToInputValue}; +use crate::schema::meta::MetaType; +use crate::value::{ScalarRefValue, ScalarValue, Value}; -use executor::{Executor, Registry}; -use types::base::GraphQLType; +use crate::executor::{Executor, Registry}; +use crate::types::base::GraphQLType; impl GraphQLType for Option where diff --git a/juniper/src/types/pointers.rs b/juniper/src/types/pointers.rs index e516b6b1..80c97422 100644 --- a/juniper/src/types/pointers.rs +++ b/juniper/src/types/pointers.rs @@ -1,11 +1,11 @@ -use ast::{FromInputValue, InputValue, Selection, ToInputValue}; +use crate::ast::{FromInputValue, InputValue, Selection, ToInputValue}; use std::fmt::Debug; use std::sync::Arc; -use executor::{ExecutionResult, Executor, Registry}; -use schema::meta::MetaType; -use types::base::{Arguments, GraphQLType}; -use value::{ScalarRefValue, ScalarValue, Value}; +use crate::executor::{ExecutionResult, Executor, Registry}; +use crate::schema::meta::MetaType; +use crate::types::base::{Arguments, GraphQLType}; +use crate::value::{ScalarRefValue, ScalarValue, Value}; impl GraphQLType for Box where diff --git a/juniper/src/types/scalars.rs b/juniper/src/types/scalars.rs index 57d27cc1..f6268509 100644 --- a/juniper/src/types/scalars.rs +++ b/juniper/src/types/scalars.rs @@ -4,12 +4,12 @@ use std::marker::PhantomData; use std::ops::Deref; use std::{char, u32}; -use ast::{FromInputValue, InputValue, Selection, ToInputValue}; -use executor::{Executor, Registry}; -use parser::{LexerError, ParseError, ScalarToken, Token}; -use schema::meta::MetaType; -use types::base::GraphQLType; -use value::{ParseScalarResult, ParseScalarValue, ScalarRefValue, ScalarValue, Value}; +use crate::ast::{FromInputValue, InputValue, Selection, ToInputValue}; +use crate::executor::{Executor, Registry}; +use crate::parser::{LexerError, ParseError, ScalarToken, Token}; +use crate::schema::meta::MetaType; +use crate::types::base::GraphQLType; +use crate::value::{ParseScalarResult, ParseScalarValue, ScalarRefValue, ScalarValue, Value}; /// An ID as defined by the GraphQL specification /// @@ -355,8 +355,8 @@ where #[cfg(test)] mod tests { use super::ID; - use parser::ScalarToken; - use value::{DefaultScalarValue, ParseScalarValue}; + use crate::parser::ScalarToken; + use crate::value::{DefaultScalarValue, ParseScalarValue}; #[test] fn test_id_from_string() { diff --git a/juniper/src/types/utilities.rs b/juniper/src/types/utilities.rs index 085f0aa1..49575423 100644 --- a/juniper/src/types/utilities.rs +++ b/juniper/src/types/utilities.rs @@ -1,8 +1,8 @@ -use ast::InputValue; -use schema::meta::{EnumMeta, InputObjectMeta, MetaType}; -use schema::model::{SchemaType, TypeType}; +use crate::ast::InputValue; +use crate::schema::meta::{EnumMeta, InputObjectMeta, MetaType}; +use crate::schema::model::{SchemaType, TypeType}; use std::collections::HashSet; -use value::ScalarValue; +use crate::value::ScalarValue; pub fn is_valid_literal_value( schema: &SchemaType, diff --git a/juniper/src/validation/context.rs b/juniper/src/validation/context.rs index b59a45ec..3b74f437 100644 --- a/juniper/src/validation/context.rs +++ b/juniper/src/validation/context.rs @@ -1,12 +1,12 @@ use std::collections::HashSet; use std::fmt::Debug; -use ast::{Definition, Document, Type}; +use crate::ast::{Definition, Document, Type}; -use schema::meta::MetaType; -use schema::model::SchemaType; +use crate::schema::meta::MetaType; +use crate::schema::model::SchemaType; -use parser::SourcePosition; +use crate::parser::SourcePosition; /// Query validation error #[derive(Debug, PartialEq, Eq, PartialOrd, Ord)] diff --git a/juniper/src/validation/input_value.rs b/juniper/src/validation/input_value.rs index 4ced7c4e..e89adaeb 100644 --- a/juniper/src/validation/input_value.rs +++ b/juniper/src/validation/input_value.rs @@ -1,13 +1,13 @@ use std::collections::HashSet; use std::fmt; -use ast::{Definition, Document, InputValue, VariableDefinitions}; -use executor::Variables; -use parser::SourcePosition; -use schema::meta::{EnumMeta, InputObjectMeta, MetaType, ScalarMeta}; -use schema::model::{SchemaType, TypeType}; -use validation::RuleError; -use value::{ScalarRefValue, ScalarValue}; +use crate::ast::{Definition, Document, InputValue, VariableDefinitions}; +use crate::executor::Variables; +use crate::parser::SourcePosition; +use crate::schema::meta::{EnumMeta, InputObjectMeta, MetaType, ScalarMeta}; +use crate::schema::model::{SchemaType, TypeType}; +use crate::validation::RuleError; +use crate::value::{ScalarRefValue, ScalarValue}; #[derive(Debug)] enum Path<'a> { diff --git a/juniper/src/validation/multi_visitor.rs b/juniper/src/validation/multi_visitor.rs index ab24563e..73077de4 100644 --- a/juniper/src/validation/multi_visitor.rs +++ b/juniper/src/validation/multi_visitor.rs @@ -1,10 +1,10 @@ -use ast::{ +use crate::ast::{ Directive, Document, Field, Fragment, FragmentSpread, InlineFragment, InputValue, Operation, Selection, VariableDefinition, }; -use parser::Spanning; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::parser::Spanning; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; #[doc(hidden)] pub struct MultiVisitorNil; diff --git a/juniper/src/validation/rules/arguments_of_correct_type.rs b/juniper/src/validation/rules/arguments_of_correct_type.rs index a8f2b8c1..e71bc572 100644 --- a/juniper/src/validation/rules/arguments_of_correct_type.rs +++ b/juniper/src/validation/rules/arguments_of_correct_type.rs @@ -1,10 +1,10 @@ -use ast::{Directive, Field, InputValue}; -use parser::Spanning; -use schema::meta::Argument; +use crate::ast::{Directive, Field, InputValue}; +use crate::parser::Spanning; +use crate::schema::meta::Argument; use std::fmt::Debug; -use types::utilities::is_valid_literal_value; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::types::utilities::is_valid_literal_value; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct ArgumentsOfCorrectType<'a, S: Debug + 'a> { current_args: Option<&'a Vec>>, @@ -76,9 +76,9 @@ fn error_message(arg_name: &str, type_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn good_null_value() { diff --git a/juniper/src/validation/rules/default_values_of_correct_type.rs b/juniper/src/validation/rules/default_values_of_correct_type.rs index 36364830..23a07cc9 100644 --- a/juniper/src/validation/rules/default_values_of_correct_type.rs +++ b/juniper/src/validation/rules/default_values_of_correct_type.rs @@ -1,8 +1,8 @@ -use ast::VariableDefinition; -use parser::Spanning; -use types::utilities::is_valid_literal_value; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::VariableDefinition; +use crate::parser::Spanning; +use crate::types::utilities::is_valid_literal_value; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct DefaultValuesOfCorrectType; @@ -62,9 +62,9 @@ fn non_null_error_message(arg_name: &str, type_name: &str) -> String { mod tests { use super::{factory, non_null_error_message, type_error_message}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn variables_with_no_default_values() { diff --git a/juniper/src/validation/rules/fields_on_correct_type.rs b/juniper/src/validation/rules/fields_on_correct_type.rs index 789ab33a..224782e8 100644 --- a/juniper/src/validation/rules/fields_on_correct_type.rs +++ b/juniper/src/validation/rules/fields_on_correct_type.rs @@ -1,8 +1,8 @@ -use ast::Field; -use parser::Spanning; -use schema::meta::MetaType; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::Field; +use crate::parser::Spanning; +use crate::schema::meta::MetaType; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct FieldsOnCorrectType; @@ -55,9 +55,9 @@ fn error_message(field: &str, type_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn selection_on_object() { diff --git a/juniper/src/validation/rules/fragments_on_composite_types.rs b/juniper/src/validation/rules/fragments_on_composite_types.rs index c9fe8cd9..0a576210 100644 --- a/juniper/src/validation/rules/fragments_on_composite_types.rs +++ b/juniper/src/validation/rules/fragments_on_composite_types.rs @@ -1,7 +1,7 @@ -use ast::{Fragment, InlineFragment}; -use parser::Spanning; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Fragment, InlineFragment}; +use crate::parser::Spanning; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct FragmentsOnCompositeTypes; @@ -73,9 +73,9 @@ fn error_message(fragment_name: Option<&str>, on_type: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn on_object() { diff --git a/juniper/src/validation/rules/known_argument_names.rs b/juniper/src/validation/rules/known_argument_names.rs index f31cc00c..58368f60 100644 --- a/juniper/src/validation/rules/known_argument_names.rs +++ b/juniper/src/validation/rules/known_argument_names.rs @@ -1,9 +1,9 @@ -use ast::{Directive, Field, InputValue}; -use parser::Spanning; -use schema::meta::Argument; +use crate::ast::{Directive, Field, InputValue}; +use crate::parser::Spanning; +use crate::schema::meta::Argument; use std::fmt::Debug; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; #[derive(Debug)] enum ArgumentPosition<'a> { @@ -106,9 +106,9 @@ fn directive_error_message(arg_name: &str, directive_name: &str) -> String { mod tests { use super::{directive_error_message, factory, field_error_message}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn single_arg_is_known() { diff --git a/juniper/src/validation/rules/known_directives.rs b/juniper/src/validation/rules/known_directives.rs index cffdfc72..15512b63 100644 --- a/juniper/src/validation/rules/known_directives.rs +++ b/juniper/src/validation/rules/known_directives.rs @@ -1,8 +1,8 @@ -use ast::{Directive, Field, Fragment, FragmentSpread, InlineFragment, Operation, OperationType}; -use parser::Spanning; -use schema::model::DirectiveLocation; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Directive, Field, Fragment, FragmentSpread, InlineFragment, Operation, OperationType}; +use crate::parser::Spanning; +use crate::schema::model::DirectiveLocation; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct KnownDirectives { location_stack: Vec, @@ -144,10 +144,10 @@ fn misplaced_error_message(directive_name: &str, location: &DirectiveLocation) - mod tests { use super::{factory, misplaced_error_message, unknown_error_message}; - use parser::SourcePosition; - use schema::model::DirectiveLocation; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::schema::model::DirectiveLocation; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn with_no_directives() { diff --git a/juniper/src/validation/rules/known_fragment_names.rs b/juniper/src/validation/rules/known_fragment_names.rs index cc9cd530..043a8bad 100644 --- a/juniper/src/validation/rules/known_fragment_names.rs +++ b/juniper/src/validation/rules/known_fragment_names.rs @@ -1,7 +1,7 @@ -use ast::FragmentSpread; -use parser::Spanning; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::FragmentSpread; +use crate::parser::Spanning; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct KnownFragmentNames; @@ -36,9 +36,9 @@ fn error_message(frag_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn known() { diff --git a/juniper/src/validation/rules/known_type_names.rs b/juniper/src/validation/rules/known_type_names.rs index 35bc2a84..93b6bd2c 100644 --- a/juniper/src/validation/rules/known_type_names.rs +++ b/juniper/src/validation/rules/known_type_names.rs @@ -1,8 +1,8 @@ -use ast::{Fragment, InlineFragment, VariableDefinition}; -use parser::{SourcePosition, Spanning}; +use crate::ast::{Fragment, InlineFragment, VariableDefinition}; +use crate::parser::{SourcePosition, Spanning}; use std::fmt::Debug; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct KnownTypeNames; @@ -61,9 +61,9 @@ fn error_message(type_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn known_type_names_are_valid() { diff --git a/juniper/src/validation/rules/lone_anonymous_operation.rs b/juniper/src/validation/rules/lone_anonymous_operation.rs index 90c9965b..6232c38a 100644 --- a/juniper/src/validation/rules/lone_anonymous_operation.rs +++ b/juniper/src/validation/rules/lone_anonymous_operation.rs @@ -1,7 +1,7 @@ -use ast::{Definition, Document, Operation}; -use parser::Spanning; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Definition, Document, Operation}; +use crate::parser::Spanning; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct LoneAnonymousOperation { operation_count: Option, @@ -49,9 +49,9 @@ fn error_message() -> &'static str { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn no_operations() { diff --git a/juniper/src/validation/rules/mod.rs b/juniper/src/validation/rules/mod.rs index cdae7559..fd2d855f 100644 --- a/juniper/src/validation/rules/mod.rs +++ b/juniper/src/validation/rules/mod.rs @@ -23,10 +23,10 @@ mod unique_variable_names; mod variables_are_input_types; mod variables_in_allowed_position; -use ast::Document; +use crate::ast::Document; use std::fmt::Debug; -use validation::{visit, MultiVisitorNil, ValidatorContext}; -use value::ScalarValue; +use crate::validation::{visit, MultiVisitorNil, ValidatorContext}; +use crate::value::ScalarValue; pub(crate) fn visit_all_rules<'a, S: Debug>(ctx: &mut ValidatorContext<'a, S>, doc: &'a Document) where diff --git a/juniper/src/validation/rules/no_fragment_cycles.rs b/juniper/src/validation/rules/no_fragment_cycles.rs index f577452e..73aadfad 100644 --- a/juniper/src/validation/rules/no_fragment_cycles.rs +++ b/juniper/src/validation/rules/no_fragment_cycles.rs @@ -1,9 +1,9 @@ use std::collections::{HashMap, HashSet}; -use ast::{Document, Fragment, FragmentSpread}; -use parser::Spanning; -use validation::{RuleError, ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Document, Fragment, FragmentSpread}; +use crate::parser::Spanning; +use crate::validation::{RuleError, ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct NoFragmentCycles<'a> { current_fragment: Option<&'a str>, @@ -133,9 +133,9 @@ fn error_message(frag_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn single_reference_is_valid() { diff --git a/juniper/src/validation/rules/no_undefined_variables.rs b/juniper/src/validation/rules/no_undefined_variables.rs index 57d20322..e7594d6c 100644 --- a/juniper/src/validation/rules/no_undefined_variables.rs +++ b/juniper/src/validation/rules/no_undefined_variables.rs @@ -1,8 +1,8 @@ -use ast::{Document, Fragment, FragmentSpread, InputValue, Operation, VariableDefinition}; -use parser::{SourcePosition, Spanning}; +use crate::ast::{Document, Fragment, FragmentSpread, InputValue, Operation, VariableDefinition}; +use crate::parser::{SourcePosition, Spanning}; use std::collections::{HashMap, HashSet}; -use validation::{RuleError, ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::validation::{RuleError, ValidatorContext, Visitor}; +use crate::value::ScalarValue; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Scope<'a> { @@ -167,9 +167,9 @@ fn error_message(var_name: &str, op_name: Option<&str>) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn all_variables_defined() { diff --git a/juniper/src/validation/rules/no_unused_fragments.rs b/juniper/src/validation/rules/no_unused_fragments.rs index 7fced6aa..7746ca92 100644 --- a/juniper/src/validation/rules/no_unused_fragments.rs +++ b/juniper/src/validation/rules/no_unused_fragments.rs @@ -1,9 +1,9 @@ use std::collections::{HashMap, HashSet}; -use ast::{Definition, Document, Fragment, FragmentSpread, Operation}; -use parser::Spanning; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Definition, Document, Fragment, FragmentSpread, Operation}; +use crate::parser::Spanning; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Scope<'a> { @@ -109,9 +109,9 @@ fn error_message(frag_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn all_fragment_names_are_used() { diff --git a/juniper/src/validation/rules/no_unused_variables.rs b/juniper/src/validation/rules/no_unused_variables.rs index 5eb2fb01..b8d3a2cc 100644 --- a/juniper/src/validation/rules/no_unused_variables.rs +++ b/juniper/src/validation/rules/no_unused_variables.rs @@ -1,8 +1,8 @@ -use ast::{Document, Fragment, FragmentSpread, InputValue, Operation, VariableDefinition}; -use parser::Spanning; +use crate::ast::{Document, Fragment, FragmentSpread, InputValue, Operation, VariableDefinition}; +use crate::parser::Spanning; use std::collections::{HashMap, HashSet}; -use validation::{RuleError, ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::validation::{RuleError, ValidatorContext, Visitor}; +use crate::value::ScalarValue; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Scope<'a> { @@ -155,9 +155,9 @@ fn error_message(var_name: &str, op_name: Option<&str>) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn uses_all_variables() { diff --git a/juniper/src/validation/rules/overlapping_fields_can_be_merged.rs b/juniper/src/validation/rules/overlapping_fields_can_be_merged.rs index 1600a537..22ac0b67 100644 --- a/juniper/src/validation/rules/overlapping_fields_can_be_merged.rs +++ b/juniper/src/validation/rules/overlapping_fields_can_be_merged.rs @@ -1,13 +1,13 @@ -use ast::{Arguments, Definition, Document, Field, Fragment, FragmentSpread, Selection, Type}; -use parser::{SourcePosition, Spanning}; -use schema::meta::{Field as FieldType, MetaType}; +use crate::ast::{Arguments, Definition, Document, Field, Fragment, FragmentSpread, Selection, Type}; +use crate::parser::{SourcePosition, Spanning}; +use crate::schema::meta::{Field as FieldType, MetaType}; use std::borrow::Borrow; use std::cell::RefCell; use std::collections::HashMap; use std::fmt::Debug; use std::hash::Hash; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; #[derive(Debug)] struct Conflict(ConflictReason, Vec, Vec); @@ -740,17 +740,17 @@ mod tests { use super::ConflictReasonMessage::*; use super::{error_message, factory, ConflictReason}; - use executor::Registry; - use schema::meta::MetaType; - use types::base::GraphQLType; - use types::scalars::{EmptyMutation, ID}; + use crate::executor::Registry; + use crate::schema::meta::MetaType; + use crate::types::base::GraphQLType; + use crate::types::scalars::{EmptyMutation, ID}; - use parser::SourcePosition; - use validation::{ + use crate::parser::SourcePosition; + use crate::validation::{ expect_fails_rule, expect_fails_rule_with_schema, expect_passes_rule, expect_passes_rule_with_schema, RuleError, }; - use value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; + use crate::value::{DefaultScalarValue, ScalarRefValue, ScalarValue}; #[test] fn unique_fields() { diff --git a/juniper/src/validation/rules/possible_fragment_spreads.rs b/juniper/src/validation/rules/possible_fragment_spreads.rs index 5792b204..7e4db398 100644 --- a/juniper/src/validation/rules/possible_fragment_spreads.rs +++ b/juniper/src/validation/rules/possible_fragment_spreads.rs @@ -1,11 +1,11 @@ use std::fmt::Debug; -use ast::{Definition, Document, FragmentSpread, InlineFragment}; -use parser::Spanning; -use schema::meta::MetaType; +use crate::ast::{Definition, Document, FragmentSpread, InlineFragment}; +use crate::parser::Spanning; +use crate::schema::meta::MetaType; use std::collections::HashMap; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct PossibleFragmentSpreads<'a, S: Debug + 'a> { fragment_types: HashMap<&'a str, &'a MetaType<'a, S>>, @@ -99,9 +99,9 @@ fn error_message(frag_name: Option<&str>, parent_type_name: &str, frag_type: &st mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn of_the_same_object() { diff --git a/juniper/src/validation/rules/provided_non_null_arguments.rs b/juniper/src/validation/rules/provided_non_null_arguments.rs index 4a918b64..a4ac1e31 100644 --- a/juniper/src/validation/rules/provided_non_null_arguments.rs +++ b/juniper/src/validation/rules/provided_non_null_arguments.rs @@ -1,9 +1,9 @@ -use ast::{Directive, Field}; -use parser::Spanning; -use schema::meta::Field as FieldType; -use schema::model::DirectiveType; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Directive, Field}; +use crate::parser::Spanning; +use crate::schema::meta::Field as FieldType; +use crate::schema::model::DirectiveType; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct ProvidedNonNullArguments; @@ -98,9 +98,9 @@ fn directive_error_message(directive_name: &str, arg_name: &str, type_name: &str mod tests { use super::{directive_error_message, factory, field_error_message}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn ignores_unknown_arguments() { diff --git a/juniper/src/validation/rules/scalar_leafs.rs b/juniper/src/validation/rules/scalar_leafs.rs index 6aff06ff..896949ad 100644 --- a/juniper/src/validation/rules/scalar_leafs.rs +++ b/juniper/src/validation/rules/scalar_leafs.rs @@ -1,7 +1,7 @@ -use ast::Field; -use parser::Spanning; -use validation::{RuleError, ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::Field; +use crate::parser::Spanning; +use crate::validation::{RuleError, ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct ScalarLeafs; @@ -57,9 +57,9 @@ fn required_error_message(field_name: &str, type_name: &str) -> String { mod tests { use super::{factory, no_allowed_error_message, required_error_message}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn valid_scalar_selection() { diff --git a/juniper/src/validation/rules/unique_argument_names.rs b/juniper/src/validation/rules/unique_argument_names.rs index 8f893f4e..36f31962 100644 --- a/juniper/src/validation/rules/unique_argument_names.rs +++ b/juniper/src/validation/rules/unique_argument_names.rs @@ -1,9 +1,9 @@ use std::collections::hash_map::{Entry, HashMap}; -use ast::{Directive, Field, InputValue}; -use parser::{SourcePosition, Spanning}; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Directive, Field, InputValue}; +use crate::parser::{SourcePosition, Spanning}; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct UniqueArgumentNames<'a> { known_names: HashMap<&'a str, SourcePosition>, @@ -54,9 +54,9 @@ fn error_message(arg_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn no_arguments_on_field() { diff --git a/juniper/src/validation/rules/unique_fragment_names.rs b/juniper/src/validation/rules/unique_fragment_names.rs index d75b16a5..edfe7423 100644 --- a/juniper/src/validation/rules/unique_fragment_names.rs +++ b/juniper/src/validation/rules/unique_fragment_names.rs @@ -1,9 +1,9 @@ use std::collections::hash_map::{Entry, HashMap}; -use ast::Fragment; -use parser::{SourcePosition, Spanning}; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::Fragment; +use crate::parser::{SourcePosition, Spanning}; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct UniqueFragmentNames<'a> { names: HashMap<&'a str, SourcePosition>, @@ -46,9 +46,9 @@ fn duplicate_message(frag_name: &str) -> String { mod tests { use super::{duplicate_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn no_fragments() { diff --git a/juniper/src/validation/rules/unique_input_field_names.rs b/juniper/src/validation/rules/unique_input_field_names.rs index 8035f7b5..8f835221 100644 --- a/juniper/src/validation/rules/unique_input_field_names.rs +++ b/juniper/src/validation/rules/unique_input_field_names.rs @@ -1,9 +1,9 @@ use std::collections::hash_map::{Entry, HashMap}; -use ast::InputValue; -use parser::{SourcePosition, Spanning}; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::InputValue; +use crate::parser::{SourcePosition, Spanning}; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct UniqueInputFieldNames<'a> { known_name_stack: Vec>, @@ -64,9 +64,9 @@ fn error_message(field_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn input_object_with_fields() { diff --git a/juniper/src/validation/rules/unique_operation_names.rs b/juniper/src/validation/rules/unique_operation_names.rs index 29e218d1..d9ce5eac 100644 --- a/juniper/src/validation/rules/unique_operation_names.rs +++ b/juniper/src/validation/rules/unique_operation_names.rs @@ -1,9 +1,9 @@ use std::collections::hash_map::{Entry, HashMap}; -use ast::Operation; -use parser::{SourcePosition, Spanning}; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::Operation; +use crate::parser::{SourcePosition, Spanning}; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct UniqueOperationNames<'a> { names: HashMap<&'a str, SourcePosition>, @@ -48,9 +48,9 @@ fn error_message(op_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn no_operations() { diff --git a/juniper/src/validation/rules/unique_variable_names.rs b/juniper/src/validation/rules/unique_variable_names.rs index 6c6eb574..b6c4e553 100644 --- a/juniper/src/validation/rules/unique_variable_names.rs +++ b/juniper/src/validation/rules/unique_variable_names.rs @@ -1,9 +1,9 @@ use std::collections::hash_map::{Entry, HashMap}; -use ast::{Operation, VariableDefinition}; -use parser::{SourcePosition, Spanning}; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Operation, VariableDefinition}; +use crate::parser::{SourcePosition, Spanning}; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct UniqueVariableNames<'a> { names: HashMap<&'a str, SourcePosition>, @@ -54,9 +54,9 @@ fn error_message(var_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn unique_variable_names() { diff --git a/juniper/src/validation/rules/variables_are_input_types.rs b/juniper/src/validation/rules/variables_are_input_types.rs index 3ff8a502..1f4616b9 100644 --- a/juniper/src/validation/rules/variables_are_input_types.rs +++ b/juniper/src/validation/rules/variables_are_input_types.rs @@ -1,7 +1,7 @@ -use ast::VariableDefinition; -use parser::Spanning; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::VariableDefinition; +use crate::parser::Spanning; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; pub struct UniqueVariableNames; @@ -43,9 +43,9 @@ fn error_message(var_name: &str, type_name: &str) -> String { mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn input_types_are_valid() { diff --git a/juniper/src/validation/rules/variables_in_allowed_position.rs b/juniper/src/validation/rules/variables_in_allowed_position.rs index ba923c04..ff9311e4 100644 --- a/juniper/src/validation/rules/variables_in_allowed_position.rs +++ b/juniper/src/validation/rules/variables_in_allowed_position.rs @@ -2,10 +2,10 @@ use std::borrow::Cow; use std::collections::{HashMap, HashSet}; use std::fmt::Debug; -use ast::{Document, Fragment, FragmentSpread, Operation, Type, VariableDefinition}; -use parser::Spanning; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::ast::{Document, Fragment, FragmentSpread, Operation, Type, VariableDefinition}; +use crate::parser::Spanning; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum Scope<'a> { @@ -161,9 +161,9 @@ fn error_message(var_name: &str, type_name: &str, expected_type_name: &str) -> S mod tests { use super::{error_message, factory}; - use parser::SourcePosition; - use validation::{expect_fails_rule, expect_passes_rule, RuleError}; - use value::DefaultScalarValue; + use crate::parser::SourcePosition; + use crate::validation::{expect_fails_rule, expect_passes_rule, RuleError}; + use crate::value::DefaultScalarValue; #[test] fn boolean_into_boolean() { diff --git a/juniper/src/validation/test_harness.rs b/juniper/src/validation/test_harness.rs index b9e9f5f1..ec79f85d 100644 --- a/juniper/src/validation/test_harness.rs +++ b/juniper/src/validation/test_harness.rs @@ -1,12 +1,12 @@ -use ast::{FromInputValue, InputValue}; -use executor::Registry; -use parser::parse_document_source; -use schema::meta::{EnumValue, MetaType}; -use schema::model::{DirectiveLocation, DirectiveType, RootNode}; -use types::base::GraphQLType; -use types::scalars::ID; -use validation::{visit, MultiVisitorNil, RuleError, ValidatorContext, Visitor}; -use value::{ScalarRefValue, ScalarValue}; +use crate::ast::{FromInputValue, InputValue}; +use crate::executor::Registry; +use crate::parser::parse_document_source; +use crate::schema::meta::{EnumValue, MetaType}; +use crate::schema::model::{DirectiveLocation, DirectiveType, RootNode}; +use crate::types::base::GraphQLType; +use crate::types::scalars::ID; +use crate::validation::{visit, MultiVisitorNil, RuleError, ValidatorContext, Visitor}; +use crate::value::{ScalarRefValue, ScalarValue}; struct Being; struct Pet; diff --git a/juniper/src/validation/traits.rs b/juniper/src/validation/traits.rs index 7f48c6ac..2491e7cd 100644 --- a/juniper/src/validation/traits.rs +++ b/juniper/src/validation/traits.rs @@ -1,10 +1,10 @@ -use ast::{ +use crate::ast::{ Directive, Document, Field, Fragment, FragmentSpread, InlineFragment, InputValue, Operation, Selection, VariableDefinition, }; -use parser::Spanning; -use validation::ValidatorContext; -use value::ScalarValue; +use crate::parser::Spanning; +use crate::validation::ValidatorContext; +use crate::value::ScalarValue; #[doc(hidden)] pub trait Visitor<'a, S> diff --git a/juniper/src/validation/visitor.rs b/juniper/src/validation/visitor.rs index 1fc981d0..be213d13 100644 --- a/juniper/src/validation/visitor.rs +++ b/juniper/src/validation/visitor.rs @@ -1,14 +1,14 @@ use std::borrow::Cow; -use ast::{ +use crate::ast::{ Arguments, Definition, Directive, Document, Field, Fragment, FragmentSpread, InlineFragment, InputValue, Operation, OperationType, Selection, Type, VariableDefinitions, }; -use parser::Spanning; -use schema::meta::Argument; -use validation::multi_visitor::MultiVisitorCons; -use validation::{ValidatorContext, Visitor}; -use value::ScalarValue; +use crate::parser::Spanning; +use crate::schema::meta::Argument; +use crate::validation::multi_visitor::MultiVisitorCons; +use crate::validation::{ValidatorContext, Visitor}; +use crate::value::ScalarValue; #[doc(hidden)] pub fn visit<'a, A, B, S>( @@ -353,7 +353,7 @@ fn enter_input_value<'a, S, V>( S: ScalarValue, V: Visitor<'a, S>, { - use InputValue::*; + use crate::InputValue::*; let start = &input_value.start; let end = &input_value.end; @@ -376,7 +376,7 @@ fn exit_input_value<'a, S, V>( S: ScalarValue, V: Visitor<'a, S>, { - use InputValue::*; + use crate::InputValue::*; let start = &input_value.start; let end = &input_value.end; diff --git a/juniper/src/value/mod.rs b/juniper/src/value/mod.rs index e3e8c155..9050920a 100644 --- a/juniper/src/value/mod.rs +++ b/juniper/src/value/mod.rs @@ -1,5 +1,5 @@ -use ast::{InputValue, ToInputValue}; -use parser::Spanning; +use crate::ast::{InputValue, ToInputValue}; +use crate::parser::Spanning; mod object; mod scalar; diff --git a/juniper/src/value/scalar.rs b/juniper/src/value/scalar.rs index f5bc8d7b..7f0b6f13 100644 --- a/juniper/src/value/scalar.rs +++ b/juniper/src/value/scalar.rs @@ -1,4 +1,4 @@ -use parser::{ParseError, ScalarToken}; +use crate::parser::{ParseError, ScalarToken}; use serde::de; use serde::ser::Serialize; use std::fmt::{self, Debug, Display}; diff --git a/juniper_codegen/Cargo.toml b/juniper_codegen/Cargo.toml index 39f9cc51..8942c461 100644 --- a/juniper_codegen/Cargo.toml +++ b/juniper_codegen/Cargo.toml @@ -9,6 +9,7 @@ description = "Internal custom derive trait for Juniper GraphQL" license = "BSD-2-Clause" documentation = "https://docs.rs/juniper" repository = "https://github.com/graphql-rust/juniper" +edition = "2018" [lib] proc-macro = true diff --git a/juniper_codegen/src/derive_enum.rs b/juniper_codegen/src/derive_enum.rs index be526e3e..2153984f 100644 --- a/juniper_codegen/src/derive_enum.rs +++ b/juniper_codegen/src/derive_enum.rs @@ -1,9 +1,8 @@ use proc_macro2::TokenStream; -use syn; -use syn::{Data, DeriveInput, Fields, Variant}; +use syn::{self, Data, DeriveInput, Fields, Variant}; -use util::*; +use crate::util::*; #[derive(Default, Debug)] struct EnumAttrs { @@ -165,7 +164,7 @@ pub fn impl_enum(ast: &syn::DeriveInput, is_internal: bool) -> TokenStream { // Build value. let name = var_attrs .name - .unwrap_or(::util::to_upper_snake_case(&variant.ident.to_string())); + .unwrap_or(crate::util::to_upper_snake_case(&variant.ident.to_string())); let descr = match var_attrs.description { Some(s) => quote! { Some(#s.to_string()) }, None => quote! { None }, diff --git a/juniper_codegen/src/derive_input_object.rs b/juniper_codegen/src/derive_input_object.rs index 2568dbba..7e029f05 100644 --- a/juniper_codegen/src/derive_input_object.rs +++ b/juniper_codegen/src/derive_input_object.rs @@ -4,7 +4,7 @@ use proc_macro2::{Span, TokenStream}; use quote::ToTokens; use syn::{self, Data, DeriveInput, Field, Fields, Ident, Meta, NestedMeta}; -use util::*; +use crate::util::*; #[derive(Default, Debug)] struct ObjAttrs { @@ -170,7 +170,7 @@ pub fn impl_input_object(ast: &syn::DeriveInput, is_internal: bool) -> TokenStre } None => { // Note: auto camel casing when no custom name specified. - ::util::to_camel_case(&field_ident.to_string()) + crate::util::to_camel_case(&field_ident.to_string()) } }; let field_description = match field_attrs.description { diff --git a/juniper_codegen/src/derive_object.rs b/juniper_codegen/src/derive_object.rs index 1fe24a73..e6a5ffe4 100644 --- a/juniper_codegen/src/derive_object.rs +++ b/juniper_codegen/src/derive_object.rs @@ -1,8 +1,7 @@ use proc_macro2::{Span, TokenStream}; -use syn; -use syn::{Data, DeriveInput, Field, Fields, Ident}; +use syn::{self, Data, DeriveInput, Field, Fields, Ident}; -use util::*; +use crate::util::*; #[derive(Default, Debug)] struct ObjAttrs { @@ -179,7 +178,7 @@ pub fn impl_object(ast: &syn::DeriveInput) -> TokenStream { } None => { // Note: auto camel casing when no custom name specified. - ::util::to_camel_case(&field_ident.to_string()) + crate::util::to_camel_case(&field_ident.to_string()) } }; let build_description = match field_attrs.description { diff --git a/juniper_hyper/Cargo.toml b/juniper_hyper/Cargo.toml index 1d4956a0..d4d9c5d6 100644 --- a/juniper_hyper/Cargo.toml +++ b/juniper_hyper/Cargo.toml @@ -6,6 +6,7 @@ description = "Juniper GraphQL integration with Hyper" license = "BSD-2-Clause" documentation = "https://docs.rs/juniper_hyper" repository = "https://github.com/graphql-rust/juniper" +edition = "2018" [dependencies] serde = "1.0" diff --git a/juniper_iron/Cargo.toml b/juniper_iron/Cargo.toml index 1fb41c60..75a258fc 100644 --- a/juniper_iron/Cargo.toml +++ b/juniper_iron/Cargo.toml @@ -9,6 +9,7 @@ description = "Iron integration for juniper" license = "BSD-2-Clause" documentation = "https://docs.rs/juniper_iron" repository = "https://github.com/graphql-rust/juniper" +edition = "2018" [dependencies] serde = { version = "1.0.2" } diff --git a/juniper_rocket/Cargo.toml b/juniper_rocket/Cargo.toml index bb796a1b..54e622e9 100644 --- a/juniper_rocket/Cargo.toml +++ b/juniper_rocket/Cargo.toml @@ -9,6 +9,7 @@ description = "Juniper GraphQL integration with Rocket" license = "BSD-2-Clause" documentation = "https://docs.rs/juniper_rocket" repository = "https://github.com/graphql-rust/juniper" +edition = "2018" [dependencies] serde = { version = "1.0.2" } diff --git a/juniper_warp/Cargo.toml b/juniper_warp/Cargo.toml index 8c52d643..d35c7837 100644 --- a/juniper_warp/Cargo.toml +++ b/juniper_warp/Cargo.toml @@ -6,6 +6,7 @@ description = "Juniper GraphQL integration with Warp" license = "BSD-2-Clause" documentation = "https://docs.rs/juniper_warp" repository = "https://github.com/graphql-rust/juniper" +edition = "2018" [dependencies] warp = "0.1.8"