From 14dbac5fd78a76592bcf4b9fbb71da3ba102e1ec Mon Sep 17 00:00:00 2001 From: Kamal Marhubi Date: Fri, 5 Feb 2016 15:59:41 -0500 Subject: config: Use write_mode from config This commit tidies up handling of `write_mode` by setting it in the config at the start, and removing the `write_mode` parameter threaded throughout the formatting process. --- src/expr.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/expr.rs') diff --git a/src/expr.rs b/src/expr.rs index b299f82a883..34a30e94899 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -427,7 +427,7 @@ impl Rewrite for ast::Block { return Some(user_str); } - let mut visitor = FmtVisitor::from_codemap(context.parse_session, context.config, None); + let mut visitor = FmtVisitor::from_codemap(context.parse_session, context.config); visitor.block_indent = context.block_indent; let prefix = match self.rules { @@ -954,9 +954,7 @@ impl Rewrite for ast::Arm { let attr_str = if !attrs.is_empty() { // We only use this visitor for the attributes, should we use it for // more? - let mut attr_visitor = FmtVisitor::from_codemap(context.parse_session, - context.config, - None); + let mut attr_visitor = FmtVisitor::from_codemap(context.parse_session, context.config); attr_visitor.block_indent = context.block_indent; attr_visitor.last_pos = attrs[0].span.lo; if attr_visitor.visit_attrs(attrs) { -- cgit 1.4.1-3-g733a5