From c270c038ef19aa650ea47c7891a450e3b58b72b9 Mon Sep 17 00:00:00 2001 From: Christoph Herzog Date: Wed, 21 Aug 2019 15:23:53 +0200 Subject: [PATCH] Enable merge_imports rustfmt setting. style: Enable rustfmt merge_imports and format This commit enables the rustfmt merge_imports setting and formats the whole code base accordingly. Note that the setting is not stable yet, but will be with Rust 1.38. In the meantime, running fmt on stable will just leave the changes alone so no problems should occur. --- juniper/src/lib.rs | 2 +- juniper/src/types/async_await.rs | 13 ++++++++----- juniper_rocket/src/lib.rs | 6 +++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/juniper/src/lib.rs b/juniper/src/lib.rs index 6317f4c6..943b8d51 100644 --- a/juniper/src/lib.rs +++ b/juniper/src/lib.rs @@ -180,7 +180,7 @@ pub use crate::{ pub type BoxFuture<'a, T> = std::pin::Pin + 'a + Send>>; #[cfg(feature = "async")] -pub use crate::types::async_await::{GraphQLTypeAsync}; +pub use crate::types::async_await::GraphQLTypeAsync; /// An error that prevented query execution #[derive(Debug, PartialEq)] diff --git a/juniper/src/types/async_await.rs b/juniper/src/types/async_await.rs index 4297c630..ec11172f 100644 --- a/juniper/src/types/async_await.rs +++ b/juniper/src/types/async_await.rs @@ -1,9 +1,12 @@ +use crate::{ + ast::{Directive, FromInputValue, InputValue, Selection}, + value::{Object, ScalarRefValue, ScalarValue, Value}, +}; -use crate::ast::{Directive, FromInputValue, InputValue, Selection}; -use crate::value::{Object, ScalarRefValue, ScalarValue, Value}; - -use crate::executor::{ExecutionResult, Executor}; -use crate::parser::Spanning; +use crate::{ + executor::{ExecutionResult, Executor}, + parser::Spanning, +}; use crate::BoxFuture; diff --git a/juniper_rocket/src/lib.rs b/juniper_rocket/src/lib.rs index 891a3723..88cf619d 100644 --- a/juniper_rocket/src/lib.rs +++ b/juniper_rocket/src/lib.rs @@ -42,14 +42,14 @@ Check the LICENSE file for details. use std::{ error::Error, - io::Cursor, + io::{Cursor, Read}, }; use rocket::{ - data::{FromDataFuture, FromDataSimple}, + data::{FromDataSimple, Outcome as FromDataOutcome}, http::{ContentType, RawStr, Status}, request::{FormItems, FromForm, FromFormValue}, - response::{content, Responder, Response, ResultFuture}, + response::{content, Responder, Response}, Data, Outcome::{Failure, Forward, Success}, Request,