
The way we generate the doc string is:
format!("/**\n{}\n */\n", lines.join("\n")),
lines in the snippet represents a Vec<String>, where each item is the content of a single #[doc = "..."] attribute.
This works great with /// comments, as the compiler converts each of these to its own #[doc = "..."] attribute, where ... is replace with the contents of the comment.
However, a /***/ comment is replaced with a single #[doc = "..."] attribute, where ... is replaced with every single character between the second and third * characters, including any leading or trailing \n.
So
is replaced with #[doc = "\n * Scan progress\n "]. This leading \n, combined with our default \n + "* " before the #[doc] contents, causes the weird blank line
Originally posted by @gustavo-shigueo in #316 (comment)
The way we generate the doc string is:
linesin the snippet represents aVec<String>, where each item is the content of a single#[doc = "..."]attribute.This works great with
///comments, as the compiler converts each of these to its own#[doc = "..."]attribute, where...is replace with the contents of the comment.However, a
/***/comment is replaced with a single#[doc = "..."]attribute, where...is replaced with every single character between the second and third*characters, including any leading or trailing\n.So
is replaced with
#[doc = "\n * Scan progress\n "]. This leading\n, combined with our default\n+"* "before the#[doc] contents, causes the weird blank lineOriginally posted by @gustavo-shigueo in #316 (comment)