Fix rustdoc test

This commit is contained in:
Esteban Küber 2025-02-27 22:29:22 +00:00
parent f1c751bc1a
commit cb82b79f02
2 changed files with 5 additions and 2 deletions

View file

@ -93,6 +93,9 @@ impl StyledBuffer {
if start == end {
return;
}
if start > self.lines[line].len() || end > self.lines[line].len() {
return;
}
let _ = self.lines[line].drain(start..(end - string.chars().count()));
for (i, c) in string.chars().enumerate() {
self.lines[line][start + i] = StyledChar::new(c, Style::LineNumber);

View file

@ -8,8 +8,8 @@ LL | ... a http://link.com
note: the lint level is defined here
--> $DIR/diagnostic-width.rs:2:9
|
LL | ...ny(rustdoc::bare_url...
| ^^^^^^^^^^^^^^^^^^
LL | ...ny(ru...are_urls)]
| ^^...^^^^^^^^
help: use an automatic link instead
|
LL | /// This is a long line that contains a <http://link.com>