diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2016-04-22 19:03:36 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2016-04-22 19:18:48 +1200 |
| commit | a9c3108c9cd6267ebaf2489fb65a07b88a4f9d4e (patch) | |
| tree | c9eb80274f8382daa8d5bd27605525af09a79598 /src/comment.rs | |
| parent | 9761cf71d8384db2a75c7595b082dd7764575851 (diff) | |
Change defaults and update tests and source
New defaults are `Tabbed` for `chain_indent` and `chain_base_indent`, and `5` for `closure_block_indent_threshold`.
Diffstat (limited to 'src/comment.rs')
| -rw-r--r-- | src/comment.rs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/comment.rs b/src/comment.rs index 9b64e3f1345..991faa3c9c8 100644 --- a/src/comment.rs +++ b/src/comment.rs @@ -70,24 +70,24 @@ pub fn rewrite_comment(orig: &str, let line_breaks = s.chars().filter(|&c| c == '\n').count(); let lines = s.lines() - .enumerate() - .map(|(i, mut line)| { - line = line.trim(); - // Drop old closer. - if i == line_breaks && line.ends_with("*/") && !line.starts_with("//") { - line = &line[..(line.len() - 2)]; - } - - line.trim_right() - }) - .map(left_trim_comment_line) - .map(|line| { - if line_breaks == 0 { - line.trim_left() - } else { - line - } - }); + .enumerate() + .map(|(i, mut line)| { + line = line.trim(); + // Drop old closer. + if i == line_breaks && line.ends_with("*/") && !line.starts_with("//") { + line = &line[..(line.len() - 2)]; + } + + line.trim_right() + }) + .map(left_trim_comment_line) + .map(|line| { + if line_breaks == 0 { + line.trim_left() + } else { + line + } + }); let mut result = opener.to_owned(); for line in lines { @@ -538,7 +538,7 @@ fn changed_comment_content(orig: &str, new: &str) -> bool { let code_comment_content = |code| { let slices = UngroupedCommentCodeSlices::new(code); slices.filter(|&(ref kind, _, _)| *kind == CodeCharKind::Comment) - .flat_map(|(_, _, s)| CommentReducer::new(s)) + .flat_map(|(_, _, s)| CommentReducer::new(s)) }; let res = code_comment_content(orig).ne(code_comment_content(new)); debug!("comment::changed_comment_content: {}\norig: '{}'\nnew: '{}'\nraw_old: {}\nraw_new: {}", |
