Skip to content

Commit 54a6aaa

Browse files
authored
Merge pull request #29 from graphql-rust/edition_2018
Using rustfix to convert to edition 2018
2 parents 03eed30 + 02d1dc7 commit 54a6aaa

File tree

15 files changed

+50
-47
lines changed

15 files changed

+50
-47
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ homepage = "https://github.com/graphql-rust/graphql-parser"
1212
documentation = "https://docs.rs/graphql-parser"
1313
version = "0.2.3"
1414
authors = ["Paul Colomiets <[email protected]>"]
15+
edition = "2018"
1516

1617
[dependencies]
1718
combine = "3.2.0"

src/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use combine::easy::Error;
55
use combine::error::StreamError;
66
use combine::combinator::{many, many1, optional, position, choice};
77

8-
use tokenizer::{Kind as T, Token, TokenStream};
9-
use helpers::{punct, ident, kind, name};
10-
use position::Pos;
8+
use crate::tokenizer::{Kind as T, Token, TokenStream};
9+
use crate::helpers::{punct, ident, kind, name};
10+
use crate::position::Pos;
1111

1212
/// Text abstracts over types that hold a string value.
1313
/// It is used to make the AST generic over the string type.

src/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Formatting graphql
22
use std::default::Default;
33

4-
use common::Directive;
4+
use crate::common::Directive;
55

66

77
#[derive(Debug, PartialEq)]
@@ -131,7 +131,7 @@ impl<'a> Formatter<'a> {
131131
}
132132

133133
pub(crate) fn format_directives<'a, T>(dirs: &[Directive<'a, T>], f: &mut Formatter)
134-
where T: ::common::Text<'a>,
134+
where T: crate::common::Text<'a>,
135135
{
136136
for dir in dirs {
137137
f.write(" ");

src/helpers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use combine::{Parser, ConsumedResult, satisfy, StreamOnce};
44
use combine::error::{Tracked};
55
use combine::stream::easy::{Error, Errors, Info};
66

7-
use tokenizer::{TokenStream, Kind, Token};
8-
use position::Pos;
7+
use crate::tokenizer::{TokenStream, Kind, Token};
8+
use crate::position::Pos;
99

1010
use super::common::{Text};
1111

@@ -20,7 +20,7 @@ pub struct TokenMatch<'a> {
2020
pub struct NameMatch<'a, T>
2121
where T: Text<'a>
2222
{
23-
phantom: PhantomData<(&'a T)>,
23+
phantom: PhantomData<&'a T>,
2424
}
2525

2626
#[derive(Debug, Clone)]

src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
//!
9494
#![warn(missing_debug_implementations)]
9595

96-
extern crate combine;
9796
#[macro_use] extern crate failure;
9897
#[cfg(test)] #[macro_use] extern crate pretty_assertions;
9998

@@ -107,7 +106,7 @@ mod helpers;
107106
pub mod query;
108107
pub mod schema;
109108

110-
pub use query::parse_query;
111-
pub use schema::parse_schema;
112-
pub use position::Pos;
113-
pub use format::Style;
109+
pub use crate::query::parse_query;
110+
pub use crate::schema::parse_schema;
111+
pub use crate::position::Pos;
112+
pub use crate::format::Style;

src/query/ast.rs

Lines changed: 2 additions & 2 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-
use position::Pos;
9-
pub use common::{Directive, Number, Value, Text, Type};
8+
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)]

src/query/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use combine::easy::Errors;
22

3-
use tokenizer::Token;
4-
use position::Pos;
3+
use crate::tokenizer::Token;
4+
use crate::position::Pos;
55

66
pub type InternalError<'a> = Errors<Token<'a>, Token<'a>, Pos>;
77

src/query/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::fmt;
22

3-
use ::format::{Displayable, Formatter, Style, format_directives};
3+
use crate::format::{Displayable, Formatter, Style, format_directives};
44

5-
use query::ast::*;
5+
use crate::query::ast::*;
66

77

88
impl<'a, T: Text<'a>> Document<'a, T>

src/query/grammar.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use combine::{parser, ParseResult, Parser};
22
use combine::combinator::{many1, eof, optional, position};
33

4-
use common::{Directive};
5-
use common::{directives, arguments, default_value, parse_type};
6-
use tokenizer::{TokenStream};
7-
use helpers::{punct, ident, name};
8-
use query::error::{ParseError};
9-
use query::ast::*;
4+
use crate::common::{Directive};
5+
use crate::common::{directives, arguments, default_value, parse_type};
6+
use crate::tokenizer::{TokenStream};
7+
use crate::helpers::{punct, ident, name};
8+
use crate::query::error::{ParseError};
9+
use crate::query::ast::*;
1010

1111
pub fn field<'a, S>(input: &mut TokenStream<'a>)
1212
-> ParseResult<Field<'a, S>, TokenStream<'a>>
@@ -208,8 +208,8 @@ pub fn parse_query<'a, S>(s: &'a str) -> Result<Document<'a, S>, ParseError>
208208

209209
#[cfg(test)]
210210
mod test {
211-
use position::Pos;
212-
use query::grammar::*;
211+
use crate::position::Pos;
212+
use crate::query::grammar::*;
213213
use super::parse_query;
214214

215215
fn ast(s: &str) -> Document<String> {

src/schema/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::str::FromStr;
22

3-
pub use common::{Directive, Type, Value, Text};
4-
use position::Pos;
3+
pub use crate::common::{Directive, Type, Value, Text};
4+
use crate::position::Pos;
55

66
#[derive(Debug, Clone, Default, PartialEq)]
77
pub struct Document<'a, T: Text<'a>>

0 commit comments

Comments
 (0)