Skip to content

Commit

Permalink
chore(fmt): run cargo fmt to resolve graphql-parser format inconsis…
Browse files Browse the repository at this point in the history
…tencies
  • Loading branch information
abernix committed Feb 26, 2021
1 parent 549c523 commit c6339a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion graphql-parser/src/query/refs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ pub enum SelectionRef<'a> {

impl<'a> SelectionRef<'a> {
pub fn is_field(&self) -> bool {
matches!(self, SelectionRef::Ref(query::Selection::Field(_)) | SelectionRef::Field(_) | SelectionRef::FieldRef(_))
matches!(
self,
SelectionRef::Ref(query::Selection::Field(_))
| SelectionRef::Field(_)
| SelectionRef::FieldRef(_)
)
}

pub fn is_aliased_field(&self) -> bool {
Expand Down
10 changes: 8 additions & 2 deletions graphql-parser/src/schema/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ pub enum TypeDefinition<'a> {

impl<'a> TypeDefinition<'a> {
pub fn is_composite_type(&self) -> bool {
matches!(self, TypeDefinition::Object(_) | TypeDefinition::Interface(_) | TypeDefinition::Union(_))
matches!(
self,
TypeDefinition::Object(_) | TypeDefinition::Interface(_) | TypeDefinition::Union(_)
)
}

pub fn is_abstract_type(&self) -> bool {
matches!(self, TypeDefinition::Interface(_) | TypeDefinition::Union(_))
matches!(
self,
TypeDefinition::Interface(_) | TypeDefinition::Union(_)
)
}
}

Expand Down

0 comments on commit c6339a2

Please sign in to comment.