-> Option<String> {
// The leading "," is not part of the arm-comment
let missed_str = match missed_str.find_uncommented(",") {
- Some(n) => &missed_str[n+1..],
+ Some(n) => &missed_str[n + 1..],
None => &missed_str[..],
};
let missed_str = if i == 0 {
context.snippet(mk_sp(open_brace_pos, arm_start_pos(arm)))
} else {
- context.snippet(mk_sp(arm_end_pos(&arms[i-1]), arm_start_pos(arm)))
+ context.snippet(mk_sp(arm_end_pos(&arms[i - 1]), arm_start_pos(arm)))
};
let comment = try_opt!(rewrite_match_arm_comment(context,
&missed_str,
};
let more_items = itemize_list(self.codemap,
- args[min_args-1..].iter(),
+ args[min_args - 1..].iter(),
")",
|arg| span_lo_for_arg(arg),
|arg| arg.ty.span.hi,
// because of the way we divide pre- and post- comments.
// Everything from the separator to the next item.
- let test_snippet = &post_snippet[comment_end-1..];
+ let test_snippet = &post_snippet[comment_end - 1..];
let first_newline = test_snippet.find('\n').unwrap_or(test_snippet.len());
// From the end of the first line of comments.
let test_snippet = &test_snippet[first_newline..];
self.buffer.push_str(&snippet[line_start..lw]);
self.buffer.push_str("\n");
} else {
- self.buffer.push_str(&snippet[line_start..i+1]);
+ self.buffer.push_str(&snippet[line_start..i + 1]);
}
line_start = i + 1;
let a_str = context.snippet(a.span);
if i > 0 {
- let comment = context.snippet(codemap::mk_sp(self[i-1].span.hi, a.span.lo));
+ let comment = context.snippet(codemap::mk_sp(self[i - 1].span.hi, a.span.lo));
// This particular horror show is to preserve line breaks in between doc
// comments. An alternative would be to force such line breaks to start
// with the usual doc comment token.