Skip to content

Commit

Permalink
Auto merge of #13554 - ageorgou:doc-links, r=xFrednet
Browse files Browse the repository at this point in the history
Documentation fixes

- In [the page describing the lints](https://rust-lang.github.io/rust-clippy/master/index.html), the View Source links are incorrect. This PR removes the extra segment causing them to fail.
  - Example before: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/clippy_lints/src/absolute_paths.rs#L13
  - Example after: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/absolute_paths.rs#L13
  - I think this was introduced in #13269.
  - I've only checked a few of the lints with the new template, but from what I can tell the metadata is generated in the same way for all of them. The `id_location` contains the full path of the lint declaration in the repository, which is why `clippy_lints` was repeated in the URL.
- Separately, fixing a typo in the explanation of `unnecessary_get_then_check`.

changelog: none
  • Loading branch information
bors committed Oct 16, 2024
2 parents ddda954 + 4863625 commit ccb30bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4046,7 +4046,7 @@ declare_clippy_lint! {
/// Checks the usage of `.get().is_some()` or `.get().is_none()` on std map types.
///
/// ### Why is this bad?
/// It can be done in one call with `.contains()`/`.contains_keys()`.
/// It can be done in one call with `.contains()`/`.contains_key()`.
///
/// ### Example
/// ```no_run
Expand Down
2 changes: 1 addition & 1 deletion util/gh-pages/index_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h2 class="panel-title"> {# #}
{# Jump to source #}
{% if let Some(id_location) = lint.id_location %}
<div class="lint-additional-info-item"> {# #}
<a href="https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/{{id_location}}">View Source</a> {# #}
<a href="https://github.com/rust-lang/rust-clippy/blob/master/{{id_location}}">View Source</a> {# #}
</div>
{% endif %}
</div> {# #}
Expand Down

0 comments on commit ccb30bf

Please sign in to comment.