]> git.lizzy.rs Git - rust.git/blobdiff - src/comment.rs
Include constness in impl blocks (#4215)
[rust.git] / src / comment.rs
index 7a0183f59af66ad14ac4ffff08b5adbf2bb6a1b2..9959ef7fd9e8405487b521d0ea918dce35726f86 100644 (file)
@@ -529,7 +529,6 @@ fn new(
             .checked_sub(closer.len() + opener.len())
             .unwrap_or(1);
         let indent_str = shape.indent.to_string_with_newline(config).to_string();
-        let fmt_indent = shape.indent + (opener.len() - line_start.len());
 
         let mut cr = CommentRewrite {
             result: String::with_capacity(orig.len() * 2),
@@ -540,14 +539,14 @@ fn new(
             comment_line_separator: format!("{}{}", indent_str, line_start),
             max_width,
             indent_str,
-            fmt_indent,
+            fmt_indent: shape.indent,
 
             fmt: StringFormat {
                 opener: "",
                 closer: "",
                 line_start,
                 line_end: "",
-                shape: Shape::legacy(max_width, fmt_indent),
+                shape: Shape::legacy(max_width, shape.indent),
                 trim_end: true,
                 config,
             },
@@ -660,7 +659,7 @@ fn handle_line(
                         config.set().wrap_comments(false);
                         if config.format_code_in_doc_comments() {
                             if let Some(s) =
-                                crate::format_code_block(&self.code_block_buffer, &config)
+                                crate::format_code_block(&self.code_block_buffer, &config, false)
                             {
                                 trim_custom_comment_prefix(&s.snippet)
                             } else {