Format with rustfmt 0.99.6-nightly
diff --git a/src/expr.rs b/src/expr.rs
index 7f43fb9..ae9cfd3 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -2524,12 +2524,13 @@
|| input.peek2(Token![!])
|| input.peek2(token::Brace)
|| input.peek2(token::Paren)
- || input.peek2(Token![..]) && !{
- let ahead = input.fork();
- ahead.parse::<Ident>()?;
- ahead.parse::<RangeLimits>()?;
- ahead.is_empty() || ahead.peek(Token![,])
- }
+ || input.peek2(Token![..])
+ && !{
+ let ahead = input.fork();
+ ahead.parse::<Ident>()?;
+ ahead.parse::<RangeLimits>()?;
+ ahead.is_empty() || ahead.peek(Token![,])
+ }
})
|| input.peek(Token![self]) && input.peek2(Token![::])
|| input.peek(Token![::])
diff --git a/src/generics.rs b/src/generics.rs
index 78c447f..4e95480 100644
--- a/src/generics.rs
+++ b/src/generics.rs
@@ -652,7 +652,10 @@
let mut bounds = Punctuated::new();
if has_colon {
loop {
- if input.peek(Token![,]) || input.peek(Token![>]) || input.peek(Token![=]) {
+ if input.peek(Token![,])
+ || input.peek(Token![>])
+ || input.peek(Token![=])
+ {
break;
}
let value = input.parse()?;
diff --git a/src/item.rs b/src/item.rs
index a851560..381ec03 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -1724,8 +1724,9 @@
&& (input.peek2(Token![>])
|| input.peek2(Token![#])
|| (input.peek2(Ident) || input.peek2(Lifetime))
- && (input.peek3(Token![:]) || input.peek3(Token![,]) || input.peek3(Token![>]))
- );
+ && (input.peek3(Token![:])
+ || input.peek3(Token![,])
+ || input.peek3(Token![>])));
let generics: Generics = if has_generics {
input.parse()?
} else {
diff --git a/src/lib.rs b/src/lib.rs
index 960afb1..f015fb0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -364,10 +364,7 @@
PredicateLifetime, PredicateType, TraitBound, TraitBoundModifier, TypeParam, TypeParamBound,
WhereClause, WherePredicate,
};
-#[cfg(all(
- any(feature = "full", feature = "derive"),
- feature = "printing"
-))]
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
pub use generics::{ImplGenerics, Turbofish, TypeGenerics};
#[cfg(feature = "full")]
@@ -437,10 +434,7 @@
#[cfg(feature = "parsing")]
pub mod ext;
pub mod punctuated;
-#[cfg(all(
- any(feature = "full", feature = "derive"),
- feature = "extra-traits"
-))]
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "extra-traits"))]
mod tt;
// Not public API except the `parse_quote!` macro.
@@ -591,10 +585,7 @@
mod span;
-#[cfg(all(
- any(feature = "full", feature = "derive"),
- feature = "printing"
-))]
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
mod print;
////////////////////////////////////////////////////////////////////////////////
diff --git a/src/lit.rs b/src/lit.rs
index 206e319..4f0779a 100644
--- a/src/lit.rs
+++ b/src/lit.rs
@@ -958,12 +958,13 @@
let mut ch = 0;
let b0 = byte(s, 0);
let b1 = byte(s, 1);
- ch += 0x10 * match b0 {
- b'0'...b'9' => b0 - b'0',
- b'a'...b'f' => 10 + (b0 - b'a'),
- b'A'...b'F' => 10 + (b0 - b'A'),
- _ => panic!("unexpected non-hex character after \\x"),
- };
+ ch += 0x10
+ * match b0 {
+ b'0'...b'9' => b0 - b'0',
+ b'a'...b'f' => 10 + (b0 - b'a'),
+ b'A'...b'F' => 10 + (b0 - b'A'),
+ _ => panic!("unexpected non-hex character after \\x"),
+ };
ch += match b1 {
b'0'...b'9' => b1 - b'0',
b'a'...b'f' => 10 + (b1 - b'a'),
diff --git a/src/macros.rs b/src/macros.rs
index 519c73c..aa995d3 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -113,10 +113,7 @@
)
}
-#[cfg(all(
- feature = "printing",
- any(feature = "full", feature = "derive")
-))]
+#[cfg(all(feature = "printing", any(feature = "full", feature = "derive")))]
macro_rules! generate_to_tokens {
(do_not_generate_to_tokens $($foo:tt)*) => ();
@@ -152,11 +149,7 @@
};
}
-#[cfg(all(
- feature = "printing",
- feature = "derive",
- not(feature = "full")
-))]
+#[cfg(all(feature = "printing", feature = "derive", not(feature = "full")))]
macro_rules! to_tokens_call {
// If the variant is marked as #full, don't auto-generate to-tokens for it.
($e:ident, $tokens:ident, #full $($rest:tt)*) => {
diff --git a/src/parse_quote.rs b/src/parse_quote.rs
index 7be6039..5d4045b 100644
--- a/src/parse_quote.rs
+++ b/src/parse_quote.rs
@@ -39,10 +39,7 @@
///
/// ```
#[cfg_attr(not(syn_can_call_macro_by_path), doc = " #[macro_use]")]
-#[cfg_attr(
- not(syn_can_call_macro_by_path),
- doc = " extern crate quote;"
-)]
+#[cfg_attr(not(syn_can_call_macro_by_path), doc = " extern crate quote;")]
/// #[macro_use]
/// extern crate syn;
///
diff --git a/src/tt.rs b/src/tt.rs
index e4f703e..8a87762 100644
--- a/src/tt.rs
+++ b/src/tt.rs
@@ -41,10 +41,11 @@
s2.next().is_none()
}
(&TokenTree::Punct(ref o1), &TokenTree::Punct(ref o2)) => {
- o1.as_char() == o2.as_char() && match (o1.spacing(), o2.spacing()) {
- (Spacing::Alone, Spacing::Alone) | (Spacing::Joint, Spacing::Joint) => true,
- _ => false,
- }
+ o1.as_char() == o2.as_char()
+ && match (o1.spacing(), o2.spacing()) {
+ (Spacing::Alone, Spacing::Alone) | (Spacing::Joint, Spacing::Joint) => true,
+ _ => false,
+ }
}
(&TokenTree::Literal(ref l1), &TokenTree::Literal(ref l2)) => {
l1.to_string() == l2.to_string()
diff --git a/src/ty.rs b/src/ty.rs
index c7da1b9..8a435ee 100644
--- a/src/ty.rs
+++ b/src/ty.rs
@@ -348,7 +348,10 @@
path: path,
})
}
- Type::TraitObject(TypeTraitObject { dyn_token: None, ref bounds }) => {
+ Type::TraitObject(TypeTraitObject {
+ dyn_token: None,
+ ref bounds,
+ }) => {
if bounds.len() > 1 || bounds.trailing_punct() {
break;
}