Fix rustdoc test
This commit is contained in:
parent
f1c751bc1a
commit
cb82b79f02
2 changed files with 5 additions and 2 deletions
|
@ -93,6 +93,9 @@ impl StyledBuffer {
|
||||||
if start == end {
|
if start == end {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if start > self.lines[line].len() || end > self.lines[line].len() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let _ = self.lines[line].drain(start..(end - string.chars().count()));
|
let _ = self.lines[line].drain(start..(end - string.chars().count()));
|
||||||
for (i, c) in string.chars().enumerate() {
|
for (i, c) in string.chars().enumerate() {
|
||||||
self.lines[line][start + i] = StyledChar::new(c, Style::LineNumber);
|
self.lines[line][start + i] = StyledChar::new(c, Style::LineNumber);
|
||||||
|
|
|
@ -8,8 +8,8 @@ LL | ... a http://link.com
|
||||||
note: the lint level is defined here
|
note: the lint level is defined here
|
||||||
--> $DIR/diagnostic-width.rs:2:9
|
--> $DIR/diagnostic-width.rs:2:9
|
||||||
|
|
|
|
||||||
LL | ...ny(rustdoc::bare_url...
|
LL | ...ny(ru...are_urls)]
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^...^^^^^^^^
|
||||||
help: use an automatic link instead
|
help: use an automatic link instead
|
||||||
|
|
|
|
||||||
LL | /// This is a long line that contains a <http://link.com>
|
LL | /// This is a long line that contains a <http://link.com>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue