Skip to content

Commit 789db77

Browse files
committed
procedural-masquerade v0.1.2
1 parent 64e196b commit 789db77

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

procedural-masquerade/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "procedural-masquerade"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
55
description = "macro_rules for making proc_macro_derive pretending to be proc_macro"
66
documentation = "https://docs.rs/procedural-masquerade/"

procedural-masquerade/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,11 @@ macro_rules! define_proc_macros {
174174
#[proc_macro_derive($proc_macro_name)]
175175
pub fn $proc_macro_name(derive_input: ::proc_macro::TokenStream)
176176
-> ::proc_macro::TokenStream {
177-
let $input = derive_input.to_string();
178-
let $input = $crate::_extract_input(&$input);
179-
fn wrapper($input: &str) -> String {
177+
fn wrapped($input: &str) -> String {
180178
$body
181179
}
182-
wrapper($input).parse().unwrap()
180+
let derive_input_string = derive_input.to_string();
181+
wrapped($crate::_extract_input(&derive_input_string)).parse().unwrap()
183182
}
184183
)+
185184
}

0 commit comments

Comments
 (0)