Skip to content

Commit 8987456

Browse files
author
Vincent Prouillet
committed
Some more derive + spacing
1 parent dccd1b6 commit 8987456

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

src/format.rs

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

4+
#[derive(Debug, PartialEq)]
45
pub(crate) struct Formatter<'a> {
56
buf: String,
67
style: &'a Style,

src/helpers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ use tokenizer::{TokenStream, Kind, Token};
88
use position::Pos;
99

1010

11-
#[derive(Clone)]
11+
#[derive(Debug, Clone)]
1212
pub struct TokenMatch<'a> {
1313
kind: Kind,
1414
phantom: PhantomData<&'a u8>,
1515
}
1616

17-
#[derive(Clone)]
17+
#[derive(Debug, Clone)]
1818
pub struct NameMatch<'a> {
1919
phantom: PhantomData<&'a u8>,
2020
}
2121

22-
#[derive(Clone)]
22+
#[derive(Debug, Clone)]
2323
pub struct Value<'a> {
2424
kind: Kind,
2525
value: &'static str,

src/query_grammar.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ pub fn parse_query(s: &str) -> Result<Document, QueryParseError> {
378378
.skip(eof())
379379
.parse_stream(&mut tokens)
380380
.map_err(|e| e.into_inner().error)?;
381+
381382
Ok(doc)
382383
}
383384

src/tokenizer.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl<'a> TokenStream<'a> {
137137
Some((_, x)) => x,
138138
None => return Err(Error::end_of_input()),
139139
};
140+
140141
match cur_char {
141142
'!' | '$' | ':' | '=' | '@' | '|' |
142143
'(' | ')' | '[' | ']' | '{' | '}' => {
@@ -200,8 +201,11 @@ impl<'a> TokenStream<'a> {
200201
if exponent.is_some() || real.is_some() {
201202
let value = &self.buf[self.off..][..len];
202203
if !check_float(value, exponent, real) {
203-
return Err(Error::unexpected_message(
204-
format_args!("unsupported float {:?}", value)));
204+
return Err(
205+
Error::unexpected_message(
206+
format_args!("unsupported float {:?}", value)
207+
)
208+
);
205209
}
206210
self.position.column += len;
207211
self.off += len;
@@ -210,8 +214,11 @@ impl<'a> TokenStream<'a> {
210214
} else {
211215
let value = &self.buf[self.off..][..len];
212216
if !check_int(value) {
213-
return Err(Error::unexpected_message(
214-
format_args!("unsupported integer {:?}", value)));
217+
return Err(
218+
Error::unexpected_message(
219+
format_args!("unsupported integer {:?}", value)
220+
)
221+
);
215222
}
216223
self.position.column += len;
217224
self.off += len;
@@ -231,7 +238,7 @@ impl<'a> TokenStream<'a> {
231238

232239
Err(
233240
Error::unexpected_message(
234-
"unterminated block string value"
241+
"unterminated block string value"
235242
)
236243
)
237244
} else {
@@ -261,7 +268,7 @@ impl<'a> TokenStream<'a> {
261268
}
262269
Err(
263270
Error::unexpected_message(
264-
"unterminated string value"
271+
"unterminated string value"
265272
)
266273
)
267274
}

0 commit comments

Comments
 (0)