Format with rustfmt 0.99.2
diff --git a/src/buffer.rs b/src/buffer.rs
index da37427..499c4f1 100644
--- a/src/buffer.rs
+++ b/src/buffer.rs
@@ -127,7 +127,10 @@
// and caution should be used when editing it. The public-facing interface is
// 100% safe but the implementation is fragile internally.
-#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
+#[cfg(all(
+ not(all(target_arch = "wasm32", target_os = "unknown")),
+ feature = "proc-macro"
+))]
use proc_macro as pm;
use proc_macro2::{Delimiter, Ident, Literal, Span, TokenStream};
use proc_macro2::{Group, Punct, TokenTree};
@@ -223,7 +226,10 @@
///
/// *This method is available if Syn is built with both the `"parsing"` and
/// `"proc-macro"` features.*
- #[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
+ #[cfg(all(
+ not(all(target_arch = "wasm32", target_os = "unknown")),
+ feature = "proc-macro"
+ ))]
pub fn new(stream: pm::TokenStream) -> TokenBuffer {
Self::new2(stream.into())
}
diff --git a/src/lib.rs b/src/lib.rs
index aefeca0..6299856 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -292,7 +292,10 @@
)
)]
-#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
+#[cfg(all(
+ not(all(target_arch = "wasm32", target_os = "unknown")),
+ feature = "proc-macro"
+))]
extern crate proc_macro;
extern crate proc_macro2;
extern crate unicode_xid;
@@ -353,12 +356,10 @@
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")]
@@ -418,12 +419,10 @@
#[cfg(any(feature = "full", feature = "derive"))]
mod path;
-#[cfg(
- all(
- any(feature = "full", feature = "derive"),
- feature = "printing"
- )
-)]
+#[cfg(all(
+ any(feature = "full", feature = "derive"),
+ feature = "printing"
+))]
pub use path::PathTokens;
#[cfg(any(feature = "full", feature = "derive"))]
pub use path::{
@@ -629,7 +628,11 @@
/// #
/// # fn main() {}
/// ```
-#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "parsing", feature = "proc-macro"))]
+#[cfg(all(
+ not(all(target_arch = "wasm32", target_os = "unknown")),
+ feature = "parsing",
+ feature = "proc-macro"
+))]
pub fn parse<T>(tokens: proc_macro::TokenStream) -> Result<T, ParseError>
where
T: Synom,
@@ -761,20 +764,16 @@
Ok(file)
}
-#[cfg(
- all(
- any(feature = "full", feature = "derive"),
- feature = "printing"
- )
-)]
+#[cfg(all(
+ any(feature = "full", feature = "derive"),
+ feature = "printing"
+))]
struct TokensOrDefault<'a, T: 'a>(&'a Option<T>);
-#[cfg(
- all(
- any(feature = "full", feature = "derive"),
- feature = "printing"
- )
-)]
+#[cfg(all(
+ any(feature = "full", feature = "derive"),
+ feature = "printing"
+))]
impl<'a, T> quote::ToTokens for TokensOrDefault<'a, T>
where
T: quote::ToTokens + Default,
diff --git a/src/macros.rs b/src/macros.rs
index e9b7034..f4e7d0a 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -113,12 +113,10 @@
)
}
-#[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)*) => ();
@@ -154,13 +152,11 @@
};
}
-#[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)*) => {
@@ -183,12 +179,10 @@
($($rest:tt)*) => (ast_struct! { $($rest)* });
}
-#[cfg(
- all(
- feature = "parsing",
- any(feature = "full", feature = "derive")
- )
-)]
+#[cfg(all(
+ feature = "parsing",
+ any(feature = "full", feature = "derive")
+))]
macro_rules! impl_synom {
($t:ident $description:tt $($parser:tt)+) => {
impl Synom for $t {
diff --git a/src/synom.rs b/src/synom.rs
index e589336..f3454eb 100644
--- a/src/synom.rs
+++ b/src/synom.rs
@@ -150,7 +150,10 @@
//!
//! *This module is available if Syn is built with the `"parsing"` feature.*
-#[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
+#[cfg(all(
+ not(all(target_arch = "wasm32", target_os = "unknown")),
+ feature = "proc-macro"
+))]
use proc_macro;
use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, TokenStream, TokenTree};
@@ -315,7 +318,10 @@
///
/// *This method is available if Syn is built with both the `"parsing"` and
/// `"proc-macro"` features.*
- #[cfg(all(not(all(target_arch = "wasm32", target_os = "unknown")), feature = "proc-macro"))]
+ #[cfg(all(
+ not(all(target_arch = "wasm32", target_os = "unknown")),
+ feature = "proc-macro"
+ ))]
fn parse(self, tokens: proc_macro::TokenStream) -> Result<Self::Output, ParseError> {
self.parse2(tokens.into())
}