Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
cf2dff2b1e3fa55fa5415d524200070d0d7aacfe
rust/tests/rustdoc/intra-doc/enum-struct-field.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
196 B
Rust
Raw Normal View History

Add support for intra-doc link fields of enum variant
2019-11-24 16:27:52 +01:00
#![crate_name = "foo"]
pub enum Foo {
X {
y: u8,
}
}
/// Hello
///
/// I want [Foo::X::y].
pub fn foo() {}
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/fn.foo.html '//a/@href' 'enum.Foo.html#variant.X.field.y'
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 542ms Template: 2ms
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