let (first_group, rest) = orig.split_at(first_group_ending);
let rewritten_first_group =
if !config.normalize_comments() && has_bare_lines && style.is_block_comment() {
- trim_left_preserve_layout(first_group, &shape.indent, config)
+ trim_left_preserve_layout(first_group, shape.indent, config)?
} else if !config.normalize_comments()
&& !config.wrap_comments()
&& !config.format_doc_comments()
/// Block that is formatted as an item.
///
/// An item starts with either a star `*` or a dash `-`. Different level of indentation are
-/// handled.
+/// handled by shrinking the shape accordingly.
struct ItemizedBlock {
/// the number of whitespaces up to the item sigil
indent: usize,
if let Some(ref ib) = self.item_block {
if ib.in_block(&line) {
- self.item_block_buffer.push_str(&line);
+ self.item_block_buffer.push_str(line.trim_start());
self.item_block_buffer.push('\n');
return false;
}