···13031303 documentation
13041304 .trim_end()
13051305 .split('\n')
13061306- .map(|line| eco_format!(" *{}", line.replace("*/", "*\\/")).to_doc(arena)),
13061306+ // Each comment line is turned into a zero width string.
13071307+ // We actually don't need to know how long a comment string is
13081308+ // because comments will never be split anyway.
13091309+ // So this saves us a lot of useless grapheme counting that would
13101310+ // otherwise have to happen if we just turned the string into a
13111311+ // regular document.
13121312+ .map(|line| arena.zero_width_string(eco_format!(" *{}", line.replace("*/", "*\\/")))),
13071313 LINE_DOCUMENT,
13081314 );
13091315