Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 61bd30e

Browse files
committed
Support nightly-2017-01-21
1 parent d66356d commit 61bd30e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ macro_rules! proc_macro_expr_impl {
3636
#[proc_macro_derive($func)]
3737
pub fn $func(input: $crate::TokenStream) -> $crate::TokenStream {
3838
let source = input.to_string();
39+
let source = source.trim();
3940

4041
let prefix = "#[allow(unused)]\nenum ProcMacroHack { Input = (stringify!(";
41-
let suffix = "), 0).1, }\n";
42+
let suffix = "), 0).1, }";
4243
if !(source.starts_with(prefix) && source.ends_with(suffix)) {
4344
panic!("`{}` procedural macro failed", stringify!($func));
4445
}
@@ -70,9 +71,10 @@ macro_rules! proc_macro_item_impl {
7071
#[proc_macro_derive($func)]
7172
pub fn $func(input: $crate::TokenStream) -> $crate::TokenStream {
7273
let source = input.to_string();
74+
let source = source.trim();
7375

7476
let prefix = "#[allow(unused)]\nenum ProcMacroHack { Input = (stringify!(";
75-
let suffix = "), 0).1, }\n";
77+
let suffix = "), 0).1, }";
7678
if !(source.starts_with(prefix) && source.ends_with(suffix)) {
7779
panic!("`{}` procedural macro failed", stringify!($func));
7880
}

0 commit comments

Comments
 (0)