Skip to content

Commit a673309

Browse files
committed
Added consume_query
1 parent 98e7446 commit a673309

File tree

5 files changed

+466
-299
lines changed

5 files changed

+466
-299
lines changed

src/lib.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,20 @@
9191
//!
9292
#![warn(missing_debug_implementations)]
9393

94-
#[cfg(test)] #[macro_use] extern crate pretty_assertions;
95-
94+
#[cfg(test)]
95+
#[macro_use]
96+
extern crate pretty_assertions;
9697

9798
mod common;
9899
#[macro_use]
99100
mod format;
100-
mod position;
101-
mod tokenizer;
102101
mod helpers;
102+
mod position;
103103
pub mod query;
104104
pub mod schema;
105+
mod tokenizer;
105106

106-
pub use crate::query::parse_query;
107-
pub use crate::schema::parse_schema;
108-
pub use crate::position::Pos;
109107
pub use crate::format::Style;
108+
pub use crate::position::Pos;
109+
pub use crate::query::{consume_query, parse_query};
110+
pub use crate::schema::parse_schema;

src/query/ast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
//!
66
//! [graphql grammar]: http://facebook.github.io/graphql/October2016/#sec-Appendix-Grammar-Summary
77
//!
8+
pub use crate::common::{Directive, Number, Text, Type, Value};
89
use crate::position::Pos;
9-
pub use crate::common::{Directive, Number, Value, Text, Type};
1010

1111
/// Root of query data
1212
#[derive(Debug, Clone, PartialEq)]
@@ -17,9 +17,9 @@ pub struct Document<'a, T: Text<'a>> {
1717
impl<'a> Document<'a, String> {
1818
pub fn into_static(self) -> Document<'static, String> {
1919
// To support both reference and owned values in the AST,
20-
// all string data is represented with the ::common::Str<'a, T: Text<'a>>
20+
// all string data is represented with the ::common::Str<'a, T: Text<'a>>
2121
// wrapper type.
22-
// This type must carry the liftetime of the query string,
22+
// This type must carry the lifetime of the query string,
2323
// and is stored in a PhantomData value on the Str type.
2424
// When using owned String types, the actual lifetime of
2525
// the Ast nodes is 'static, since no references are kept,

0 commit comments

Comments
 (0)