]> git.lizzy.rs Git - rust.git/blobdiff - src/comment.rs
0.99.7
[rust.git] / src / comment.rs
index e76bb3318562e78d85a5036121de00df03ef4557..4ba95bda053867caaacee25a799a5fd2901f7790 100644 (file)
@@ -332,7 +332,7 @@ fn consume_same_line_comments(
     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()
@@ -398,7 +398,7 @@ fn new(attribute: &str) -> CodeBlockAttribute {
 /// 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,
@@ -585,7 +585,7 @@ fn handle_line(
 
         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;
             }