diff --git a/src/expr.rs b/src/expr.rs index fa941e6146a..60e0e007b1d 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1933,7 +1933,7 @@ fn rewrite_unary_op( shape: Shape, ) -> Option { // For some reason, an UnOp is not spanned like BinOp! - rewrite_unary_prefix(context, ast::UnOp::to_string(op), expr, shape) + rewrite_unary_prefix(context, op.as_str(), expr, shape) } pub(crate) enum RhsAssignKind<'ast> { diff --git a/src/pairs.rs b/src/pairs.rs index 07c05193739..bfc2ffed383 100644 --- a/src/pairs.rs +++ b/src/pairs.rs @@ -339,7 +339,7 @@ fn flatten( if let Some(pop) = stack.pop() { match pop.kind { ast::ExprKind::Binary(op, _, ref rhs) => { - separators.push(op.node.to_string()); + separators.push(op.node.as_str()); node = rhs; } _ => unreachable!(),