about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShotaro Yamada <sinkuu@sinkuu.xyz>2018-10-09 21:47:00 +0900
committerShotaro Yamada <sinkuu@sinkuu.xyz>2018-10-15 23:59:08 +0900
commitd55729987ff798b49838e5b5707cfca807b5b6b7 (patch)
tree056c82bf3131ee20a9ca20b8585b51b3db730098
parent094e687e42a19b747203fa1967d192c5384ef459 (diff)
Use UnOp::to_string
-rw-r--r--src/expr.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/expr.rs b/src/expr.rs
index 752fb792899..48a493c8a74 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1815,12 +1815,7 @@ fn rewrite_unary_op(
     shape: Shape,
 ) -> Option<String> {
     // For some reason, an UnOp is not spanned like BinOp!
-    let operator_str = match op {
-        ast::UnOp::Deref => "*",
-        ast::UnOp::Not => "!",
-        ast::UnOp::Neg => "-",
-    };
-    rewrite_unary_prefix(context, operator_str, expr, shape)
+    rewrite_unary_prefix(context, ast::UnOp::to_string(op), expr, shape)
 }
 
 fn rewrite_assignment(