From cc115ff1a77726f31eb800c11a666633778ee5bb Mon Sep 17 00:00:00 2001 From: Koxiaet <38139193+Koxiaet@users.noreply.github.com> Date: Thu, 15 Oct 2020 06:56:17 +0100 Subject: [PATCH] Rustfmt --- src/context.rs | 20 ++++++++++++-------- src/lib.rs | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/context.rs b/src/context.rs index 82308f8e..42b2635c 100644 --- a/src/context.rs +++ b/src/context.rs @@ -188,20 +188,24 @@ impl<'a> QueryPathNode<'a> { /// /// This traverses all the parents of the node until it finds one that is a field name. pub fn field_name(&self) -> &str { - self.parents().find_map(|node| match node.segment { - QueryPathSegment::Name(name) => Some(name), - QueryPathSegment::Index(_) => None, - }).unwrap() + self.parents() + .find_map(|node| match node.segment { + QueryPathSegment::Name(name) => Some(name), + QueryPathSegment::Index(_) => None, + }) + .unwrap() } /// Get the path represented by `Vec`; numbers will be stringified. #[must_use] pub fn to_string_vec(&self) -> Vec { let mut res = Vec::new(); - self.for_each(|s| res.push(match s { - QueryPathSegment::Name(name) => name.to_string(), - QueryPathSegment::Index(idx) => idx.to_string(), - })); + self.for_each(|s| { + res.push(match s { + QueryPathSegment::Name(name) => name.to_string(), + QueryPathSegment::Index(idx) => idx.to_string(), + }) + }); res } diff --git a/src/lib.rs b/src/lib.rs index 58667710..fb583ca6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -122,8 +122,8 @@ mod schema; mod subscription; mod validation; -pub mod extensions; pub mod context; +pub mod extensions; pub mod guard; pub mod http; pub mod resolver_utils; @@ -169,9 +169,9 @@ pub use response::{BatchResponse, Response}; pub use schema::{Schema, SchemaBuilder, SchemaEnv}; pub use validation::ValidationMode; +pub use context::*; #[doc(no_inline)] pub use parser::{Pos, Positioned}; -pub use context::*; pub use types::*; /// An alias of [async_graphql::Error](struct.Error.html). Present for backward compatibility