diff options
| author | Seiichi Uchida <seuchida@gmail.com> | 2019-02-04 00:10:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-04 00:10:42 +0900 |
| commit | efd6fda43fb9dc6324905572ba64b984cf88f85a (patch) | |
| tree | d8e23debc65adf8a16c1c1c9a01c749eb4a3d2b8 /src/expr.rs | |
| parent | 7c0f59bee3df5d584fb3d2b1ba1b654e2ab4ae73 (diff) | |
| parent | c2534f53247b31647b8b457a2bb90757b695b9ad (diff) | |
Merge pull request #3311 from rchaser53/issue-3295
fix "internal error: left behind trailing whitespace" with long lines
Diffstat (limited to 'src/expr.rs')
| -rw-r--r-- | src/expr.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/expr.rs b/src/expr.rs index 0d8e9c87580..1468b3bdd8e 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -22,7 +22,7 @@ use comment::{ combine_strs_with_missing_comments, contains_comment, recover_comment_removed, rewrite_comment, rewrite_missing_comment, CharClasses, FindUncommented, }; -use config::{Config, ControlBraceStyle, IndentStyle}; +use config::{Config, ControlBraceStyle, IndentStyle, Version}; use lists::{ definitive_tactic, itemize_list, shape_for_tactic, struct_lit_formatting, struct_lit_shape, struct_lit_tactic, write_list, ListFormatting, ListItem, Separator, @@ -1264,7 +1264,11 @@ fn rewrite_string_lit(context: &RewriteContext, span: Span, shape: Shape) -> Opt .join("\n") .trim_start(), ); - return wrap_str(indented_string_lit, context.config.max_width(), shape); + return if context.config.version() == Version::Two { + Some(indented_string_lit) + } else { + wrap_str(indented_string_lit, context.config.max_width(), shape) + }; } else { return wrap_str(string_lit.to_owned(), context.config.max_width(), shape); } |
