diff options
| author | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2018-10-09 21:28:40 +0900 |
|---|---|---|
| committer | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2018-10-15 23:58:59 +0900 |
| commit | 094e687e42a19b747203fa1967d192c5384ef459 (patch) | |
| tree | c850d4d47b19ce6ee0648d5e9c9850fd47edb341 | |
| parent | 075aa909cd2bcdc603f45e0b65119c6a7e3b2030 (diff) | |
Remove an unsafe code
| -rw-r--r-- | src/visitor.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/visitor.rs b/src/visitor.rs index 30752826a85..7b952c20f52 100644 --- a/src/visitor.rs +++ b/src/visitor.rs @@ -792,13 +792,9 @@ impl<'b, 'a: 'b> FmtVisitor<'a> { where F: Fn(&RewriteContext) -> Option<String>, { - let result; - let macro_rewrite_failure = { - let context = self.get_context(); - result = f(&context); - unsafe { *context.macro_rewrite_failure.as_ptr() } - }; - self.macro_rewrite_failure |= macro_rewrite_failure; + let context = self.get_context(); + let result = f(&context); + self.macro_rewrite_failure |= *context.macro_rewrite_failure.borrow(); result } |
