We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49e6db7 commit f00d72bCopy full SHA for f00d72b
src/librustdoc/html/render.rs
@@ -714,13 +714,18 @@ impl<'self> fmt::Default for Item<'self> {
714
do clean_srcpath(it.item.source.filename) |component| {
715
path.push(component.to_owned());
716
}
717
+ let href = if it.item.source.loline == it.item.source.hiline {
718
+ format!("{}", it.item.source.loline)
719
+ } else {
720
+ format!("{}-{}", it.item.source.loline, it.item.source.hiline)
721
+ };
722
write!(fmt.buf,
723
"<a class='source'
- href='{root}src/{crate}/{path}.html\\#{line}'>[src]</a>",
724
+ href='{root}src/{crate}/{path}.html\\#{href}'>[src]</a>",
725
root = it.cx.root_path,
726
crate = it.cx.layout.crate,
727
path = path.connect("/"),
- line = it.item.source.loline);
728
+ href = href);
729
730
731
// Write the breadcrumb trail header for the top
0 commit comments