where I: Iterator<Item = &'a ast::Expr>
{
let bracket_size = if context.config.spaces_within_square_brackets {
- 2 // "[ "
+ 2 // "[ "
} else {
- 1 // "["
+ 1 // "["
};
let offset = offset + bracket_size;
let inner_context = &RewriteContext { block_indent: offset, ..*context };
let fix_indent = last_char.map_or(true, |rev_c| ['{', '\n'].contains(&rev_c));
- if rewrite_next_comment && fix_indent {
- if let Some('{') = last_char {
- self.buffer.push_str("\n");
+ if rewrite_next_comment {
+ if fix_indent {
+ if let Some('{') = last_char {
+ self.buffer.push_str("\n");
+ }
+ self.buffer.push_str(&self.block_indent.to_string(self.config));
+ } else {
+ self.buffer.push_str(" ");
}
let comment_width = ::std::cmp::min(self.config.ideal_width,
self.config.max_width -
self.block_indent.width());
- self.buffer.push_str(&self.block_indent.to_string(self.config));
self.buffer.push_str(&rewrite_comment(subslice,
false,
comment_width,
// comment
// comment2
+ // FIXME(1275)
code(); /* leave this comment alone!
* ok? */
// comment
// comment2
+ // FIXME(1275)
code(); /* leave this comment alone!
* ok? */
// comment
// comment2
- code(); /* leave this comment alone!
- * ok? */
+ // FIXME(1275)
+ code(); // leave this comment alone!
+ // ok?
// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a
// diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
// self.config)
// .unwrap());
- funk(); //dontchangeme
- // or me
+ funk(); // dontchangeme
+ // or me
}
/// test123
// comment
// comment2
+ // FIXME(1275)
code(); /* leave this comment alone!
- * ok? */
+ * ok? */
/* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a
* diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
// .unwrap());
funk(); //dontchangeme
- // or me
+ // or me
}
/// test123
Cell::new(42usize,
remaining_widthremaining_widthremaining_widthremaining_width),
42usize);
- let rc = RefCell::new(42usize, remaining_width, remaining_width); // a comment
+ let rc = RefCell::new(42usize, remaining_width, remaining_width); // a comment
let x = "Hello!!!!!!!!! abcd abcd abcd abcd abcd abcd\n abcd abcd abcd abcd abcd abcd abcd \
abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \
abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \