Skip to content

Using rustfix to convert to edition 2018 #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ homepage = "https://github.com/graphql-rust/graphql-parser"
documentation = "https://docs.rs/graphql-parser"
version = "0.2.3"
authors = ["Paul Colomiets <paul@colomiets.name>"]
edition = "2018"

[dependencies]
combine = "3.2.0"
Expand Down
6 changes: 3 additions & 3 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use combine::easy::Error;
use combine::error::StreamError;
use combine::combinator::{many, many1, optional, position, choice};

use tokenizer::{Kind as T, Token, TokenStream};
use helpers::{punct, ident, kind, name};
use position::Pos;
use crate::tokenizer::{Kind as T, Token, TokenStream};
use crate::helpers::{punct, ident, kind, name};
use crate::position::Pos;

/// Text abstracts over types that hold a string value.
/// It is used to make the AST generic over the string type.
Expand Down
4 changes: 2 additions & 2 deletions src/format.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Formatting graphql
use std::default::Default;

use common::Directive;
use crate::common::Directive;


#[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -131,7 +131,7 @@ impl<'a> Formatter<'a> {
}

pub(crate) fn format_directives<'a, T>(dirs: &[Directive<'a, T>], f: &mut Formatter)
where T: ::common::Text<'a>,
where T: crate::common::Text<'a>,
{
for dir in dirs {
f.write(" ");
Expand Down
6 changes: 3 additions & 3 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use combine::{Parser, ConsumedResult, satisfy, StreamOnce};
use combine::error::{Tracked};
use combine::stream::easy::{Error, Errors, Info};

use tokenizer::{TokenStream, Kind, Token};
use position::Pos;
use crate::tokenizer::{TokenStream, Kind, Token};
use crate::position::Pos;

use super::common::{Text};

Expand All @@ -20,7 +20,7 @@ pub struct TokenMatch<'a> {
pub struct NameMatch<'a, T>
where T: Text<'a>
{
phantom: PhantomData<(&'a T)>,
phantom: PhantomData<&'a T>,
}

#[derive(Debug, Clone)]
Expand Down
9 changes: 4 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
//!
#![warn(missing_debug_implementations)]

extern crate combine;
#[macro_use] extern crate failure;
#[cfg(test)] #[macro_use] extern crate pretty_assertions;

Expand All @@ -107,7 +106,7 @@ mod helpers;
pub mod query;
pub mod schema;

pub use query::parse_query;
pub use schema::parse_schema;
pub use position::Pos;
pub use format::Style;
pub use crate::query::parse_query;
pub use crate::schema::parse_schema;
pub use crate::position::Pos;
pub use crate::format::Style;
4 changes: 2 additions & 2 deletions src/query/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
//!
//! [graphql grammar]: http://facebook.github.io/graphql/October2016/#sec-Appendix-Grammar-Summary
//!
use position::Pos;
pub use common::{Directive, Number, Value, Text, Type};
use crate::position::Pos;
pub use crate::common::{Directive, Number, Value, Text, Type};

/// Root of query data
#[derive(Debug, Clone, PartialEq)]
Expand Down
4 changes: 2 additions & 2 deletions src/query/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use combine::easy::Errors;

use tokenizer::Token;
use position::Pos;
use crate::tokenizer::Token;
use crate::position::Pos;

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

Expand Down
4 changes: 2 additions & 2 deletions src/query/format.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::fmt;

use ::format::{Displayable, Formatter, Style, format_directives};
use crate::format::{Displayable, Formatter, Style, format_directives};

use query::ast::*;
use crate::query::ast::*;


impl<'a, T: Text<'a>> Document<'a, T>
Expand Down
16 changes: 8 additions & 8 deletions src/query/grammar.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use combine::{parser, ParseResult, Parser};
use combine::combinator::{many1, eof, optional, position};

use common::{Directive};
use common::{directives, arguments, default_value, parse_type};
use tokenizer::{TokenStream};
use helpers::{punct, ident, name};
use query::error::{ParseError};
use query::ast::*;
use crate::common::{Directive};
use crate::common::{directives, arguments, default_value, parse_type};
use crate::tokenizer::{TokenStream};
use crate::helpers::{punct, ident, name};
use crate::query::error::{ParseError};
use crate::query::ast::*;

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

#[cfg(test)]
mod test {
use position::Pos;
use query::grammar::*;
use crate::position::Pos;
use crate::query::grammar::*;
use super::parse_query;

fn ast(s: &str) -> Document<String> {
Expand Down
4 changes: 2 additions & 2 deletions src/schema/ast.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::str::FromStr;

pub use common::{Directive, Type, Value, Text};
use position::Pos;
pub use crate::common::{Directive, Type, Value, Text};
use crate::position::Pos;

#[derive(Debug, Clone, Default, PartialEq)]
pub struct Document<'a, T: Text<'a>>
Expand Down
4 changes: 2 additions & 2 deletions src/schema/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use combine::easy::Errors;

use tokenizer::Token;
use position::Pos;
use crate::tokenizer::Token;
use crate::position::Pos;

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

Expand Down
6 changes: 3 additions & 3 deletions src/schema/format.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::fmt;

use ::format::{Displayable, Formatter, Style, format_directives};
use ::common::Text;
use crate::format::{Displayable, Formatter, Style, format_directives};
use crate::common::Text;

use schema::ast::*;
use crate::schema::ast::*;


impl<'a, T> Document<'a, T>
Expand Down
20 changes: 10 additions & 10 deletions src/schema/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use combine::combinator::{many, many1, eof, optional, position, choice};
use combine::combinator::{sep_by1};
use failure::Fail;

use tokenizer::{Kind as T, Token, TokenStream};
use helpers::{punct, ident, kind, name};
use common::{directives, string, default_value, parse_type, Text};
use schema::error::{ParseError};
use schema::ast::*;
use crate::tokenizer::{Kind as T, Token, TokenStream};
use crate::helpers::{punct, ident, kind, name};
use crate::common::{directives, string, default_value, parse_type, Text};
use crate::schema::error::{ParseError};
use crate::schema::ast::*;


pub fn schema<'a, S>(input: &mut TokenStream<'a>)
Expand Down Expand Up @@ -510,9 +510,9 @@ pub fn described_definition<'a, T>(input: &mut TokenStream<'a>)
// that means parser will need to backtrace, and that in turn
// means that error reporting is bad (along with performance)
.map(|(descr, mut def)| {
use schema::ast::TypeDefinition::*;
use schema::ast::Definition::*;
use schema::ast::Definition::{TypeDefinition as T};
use crate::schema::ast::TypeDefinition::*;
use crate::schema::ast::Definition::*;
use crate::schema::ast::Definition::{TypeDefinition as T};
match def {
T(Scalar(ref mut s)) => s.description = descr,
T(Object(ref mut o)) => o.description = descr,
Expand Down Expand Up @@ -574,8 +574,8 @@ pub fn parse_schema<'a, T>(s: &'a str) -> Result<Document<'a, T>, ParseError>

#[cfg(test)]
mod test {
use position::Pos;
use schema::grammar::*;
use crate::position::Pos;
use crate::schema::grammar::*;
use super::parse_schema;

fn ast(s: &str) -> Document<String> {
Expand Down
2 changes: 1 addition & 1 deletion src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use combine::error::{StreamError};
use combine::stream::{Resetable};
use combine::easy::{Error, Errors};

use position::Pos;
use crate::position::Pos;


#[derive(Debug, PartialEq, Eq, Clone, Copy)]
Expand Down
7 changes: 5 additions & 2 deletions vagga.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ containers:
- !Install [ca-certificates, git, build-essential, vim]

- !TarInstall
url: "https://static.rust-lang.org/dist/rust-1.38.0-x86_64-unknown-linux-gnu.tar.gz"
url: "https://static.rust-lang.org/dist/rust-1.42.0-x86_64-unknown-linux-gnu.tar.gz"
script: "./install.sh --prefix=/usr \
--components=rustc,rust-std-x86_64-unknown-linux-gnu,cargo"
- !TarInstall
url: "https://static.rust-lang.org/dist/rust-std-1.38.0-wasm32-unknown-unknown.tar.gz"
url: "https://static.rust-lang.org/dist/rust-std-1.42.0-wasm32-unknown-unknown.tar.gz"
script: "./install.sh --prefix=/usr --components=rust-std-wasm32-unknown-unknown"
- &bulk !Tar
url: "https://github.com/tailhook/bulk/releases/download/v0.4.10/bulk-v0.4.10.tar.gz"
sha256: 481513f8a0306a9857d045497fb5b50b50a51e9ff748909ecf7d2bda1de275ab
path: /
- !Sh |
cargo install cargo-fix --root=/usr


environ:
HOME: /work/target
Expand Down