diff options
| author | Kamal Marhubi <kamal@marhubi.com> | 2016-02-05 15:59:41 -0500 |
|---|---|---|
| committer | Kamal Marhubi <kamal@marhubi.com> | 2016-02-08 22:52:44 -0500 |
| commit | 14dbac5fd78a76592bcf4b9fbb71da3ba102e1ec (patch) | |
| tree | c28cc92739a5dc1c2a89f553a81c247659b26c10 /src/expr.rs | |
| parent | 0fb71d0d7db336a2f3fd8860011cabdf2908d424 (diff) | |
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.
Diffstat (limited to 'src/expr.rs')
| -rw-r--r-- | src/expr.rs | 6 |
1 files changed, 2 insertions, 4 deletions
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) { |
