diff options
| author | Nick Cameron <nrc@ncameron.org> | 2015-06-23 06:18:07 -0700 |
|---|---|---|
| committer | Nick Cameron <nrc@ncameron.org> | 2015-06-23 06:18:07 -0700 |
| commit | 66c6fe53346c575cd6d7a4ce581b1e7ecda5e7bb (patch) | |
| tree | aa9460e73e576defa78827c505153159bd4de6bc /src/expr.rs | |
| parent | 1488d5eadb4ccd7138e0fb6fd6eb6911f6386255 (diff) | |
| parent | d7b49fd76ce4d38beda129c7b8a733e62729bcb0 (diff) | |
Merge pull request #112 from marcusklaas/config-fix
Remove global mutable config to allow for concurrency
Diffstat (limited to 'src/expr.rs')
| -rw-r--r-- | src/expr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/expr.rs b/src/expr.rs index 85ea41fb060..dae64891ab3 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -62,7 +62,7 @@ fn rewrite_string_lit(context: &RewriteContext, s: &str, span: Span, width: usiz // strings, or if the string is too long for the line. let l_loc = context.codemap.lookup_char_pos(span.lo); let r_loc = context.codemap.lookup_char_pos(span.hi); - if l_loc.line == r_loc.line && r_loc.col.to_usize() <= config!(max_width) { + if l_loc.line == r_loc.line && r_loc.col.to_usize() <= context.config.max_width { return context.codemap.span_to_snippet(span).ok(); } @@ -82,7 +82,7 @@ fn rewrite_string_lit(context: &RewriteContext, s: &str, span: Span, width: usiz // First line. width - 2 // 2 = " + \ } else { - config!(max_width) - offset - 1 // 1 = either \ or ; + context.config.max_width - offset - 1 // 1 = either \ or ; }; let mut cur_end = cur_start + max_chars; @@ -206,7 +206,7 @@ fn rewrite_struct_lit(context: &RewriteContext, trailing_separator: if base.is_some() { SeparatorTactic::Never } else { - config!(struct_lit_trailing_comma) + context.config.struct_lit_trailing_comma }, indent: indent, h_width: budget, @@ -247,7 +247,7 @@ fn rewrite_tuple_lit(context: &RewriteContext, let rem_width = if i == items.len() - 1 { width - 2 } else { - config!(max_width) - indent - 2 + context.config.max_width - indent - 2 }; item.rewrite(context, rem_width, indent) }) |
