Rustfmt
This commit is contained in:
parent
4eaa9cb86e
commit
cc115ff1a7
|
@ -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<String>`; numbers will be stringified.
|
||||
#[must_use]
|
||||
pub fn to_string_vec(&self) -> Vec<String> {
|
||||
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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user