missing_safety_doc: Handle 'implementation safety' headers as well by Manisheart...
source link: https://github.com/rust-lang/rust-clippy/pull/7856
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
r? @xFrednet
(rust-highfive has picked a reviewer for you, use r? to override)
Outdated
headers.safety |= in_heading && text.trim() == "Safety";
headers.safety |= in_heading && text.trim() == "Implementation safety";
headers.safety |= in_heading && text.trim() == "Implementation Safety";
headers.errors |= in_heading && text.trim() == "Errors";
headers.panics |= in_heading && text.trim() == "Panics";
if in_code {
Would it maybe be better to have one let text = text.trim().to_lowercase()
and use that for all comparisons? (I'm not certain if these are defined headings by rustdoc or just by us). The changes look fine otherwise
to_lowercase()
needs it to be allocated unfortunately (and trim
does not)
Factored the text.trim()
out
Alright , just for future reference. Does rustdoc actually display these headlines differently, or are they basically a community / Clippy convention?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK