Skip to content

Commit 48ea504

Browse files
committed
Format with rustfmt 0.4.2
1 parent 7b052ae commit 48ea504

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,9 @@ pub mod token_stream {
588588
use std::marker;
589589
use std::rc::Rc;
590590

591+
use imp;
591592
pub use TokenStream;
592593
use TokenTree;
593-
use imp;
594594

595595
pub struct IntoIter {
596596
inner: imp::TokenTreeIter,

src/stable.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,12 +665,12 @@ fn token_stream(mut input: Cursor) -> PResult<::TokenStream> {
665665
loop {
666666
let input_no_ws = skip_whitespace(input);
667667
if input_no_ws.rest.len() == 0 {
668-
break
668+
break;
669669
}
670670
if let Ok((a, tokens)) = doc_comment(input_no_ws) {
671671
input = a;
672672
trees.extend(tokens);
673-
continue
673+
continue;
674674
}
675675

676676
let (a, tt) = match token_tree(input_no_ws) {
@@ -689,7 +689,7 @@ fn spanned<'a, T>(
689689
f: fn(Cursor<'a>) -> PResult<'a, T>,
690690
) -> PResult<'a, (T, ::Span)> {
691691
let (a, b) = f(skip_whitespace(input))?;
692-
Ok((a, ((b, ::Span::_new(Span { })))))
692+
Ok((a, ((b, ::Span::_new(Span {})))))
693693
}
694694

695695
#[cfg(procmacro2_semver_exempt)]
@@ -1162,7 +1162,7 @@ fn float_digits(input: Cursor) -> PResult<()> {
11621162
fn int(input: Cursor) -> PResult<()> {
11631163
let (rest, ()) = digits(input)?;
11641164
for suffix in &[
1165-
"isize", "i8", "i16", "i32", "i64", "i128", "usize", "u8", "u16", "u32", "u64", "u128"
1165+
"isize", "i8", "i16", "i32", "i64", "i128", "usize", "u8", "u16", "u32", "u64", "u128",
11661166
] {
11671167
if rest.starts_with(suffix) {
11681168
return word_break(rest.advance(suffix.len()));

src/unstable.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ impl From<TokenTree> for TokenStream {
8282

8383
impl iter::FromIterator<TokenTree> for TokenStream {
8484
fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self {
85-
let streams = streams.into_iter().map(TokenStream::from)
86-
.flat_map(|t| t.0);
85+
let streams = streams.into_iter().map(TokenStream::from).flat_map(|t| t.0);
8786
TokenStream(streams.collect::<proc_macro::TokenStream>())
8887
}
8988
}
@@ -138,16 +137,8 @@ impl Iterator for TokenTreeIter {
138137
o.set_span(::Span::_new(Span(tt.span())));
139138
o.into()
140139
}
141-
proc_macro::TokenTree::Term(s) => {
142-
::Term::_new(Term {
143-
term: s,
144-
}).into()
145-
}
146-
proc_macro::TokenTree::Literal(l) => {
147-
::Literal::_new(Literal {
148-
lit: l,
149-
}).into()
150-
}
140+
proc_macro::TokenTree::Term(s) => ::Term::_new(Term { term: s }).into(),
141+
proc_macro::TokenTree::Literal(l) => ::Literal::_new(Literal { lit: l }).into(),
151142
})
152143
}
153144

@@ -322,9 +313,7 @@ macro_rules! unsuffixed_integers {
322313

323314
impl Literal {
324315
fn _new(lit: proc_macro::Literal) -> Literal {
325-
Literal {
326-
lit,
327-
}
316+
Literal { lit }
328317
}
329318

330319
suffixed_numbers! {
@@ -364,7 +353,6 @@ impl Literal {
364353
Literal::_new(proc_macro::Literal::f64_unsuffixed(f))
365354
}
366355

367-
368356
pub fn string(t: &str) -> Literal {
369357
Literal::_new(proc_macro::Literal::string(t))
370358
}

tests/test.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ fn terms() {
1313

1414
#[test]
1515
fn raw_terms() {
16-
assert_eq!(Term::new("r#String", Span::call_site()).as_str(), "r#String");
16+
assert_eq!(
17+
Term::new("r#String", Span::call_site()).as_str(),
18+
"r#String"
19+
);
1720
assert_eq!(Term::new("r#fn", Span::call_site()).as_str(), "r#fn");
1821
assert_eq!(Term::new("r#_", Span::call_site()).as_str(), "r#_");
1922
}

0 commit comments

Comments
 (0)