Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
b60f7b51a27dfd9cbc5ecaa56ee679cd1b67f4c4
rust/tests/rustdoc/issue-72340.rs

20 lines
313 B
Rust
Raw Normal View History

Make intra-link resolve links for both trait and impl items
2020-05-19 13:54:22 +02:00
#![crate_name = "foo"]
pub struct Body;
impl Body {
pub fn empty() -> Self {
Body
}
}
impl Default for Body {
rustdoc: use more precise relative URLS Instead of using a depth counter and adding "../" to get to the top, this commit makes rustdoc actually compare the path of what it's linking from to the path that it's linking to. This makes the resulting HTML shorter. Here's a comparison of one of the largest (non-source) files in the Rust standard library docs (about 4% improvement before gzipping). $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html 2387389 struct.Wrapping.old.html 2298538 struct.Wrapping.new.html Most if it can be efficiently gzipped away. $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz 70679 struct.Wrapping.old.html.gz 70050 struct.Wrapping.new.html.gz But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.
2021-03-17 11:41:01 -07:00
// @has foo/struct.Body.html '//a/@href' 'struct.Body.html#method.empty'
Make intra-link resolve links for both trait and impl items
2020-05-19 13:54:22 +02:00
/// Returns [`Body::empty()`](Body::empty).
fn default() -> Body {
Body::empty()
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 826ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API