Skip to content

Commit

Permalink
Use relative links instead of intra-doc links
Browse files Browse the repository at this point in the history
Previously, `BTreeMap` tried to link to `crate::collections`, intending
for the link to go to `std/collections/index.html`. But `BTreeMap` is
defined in `alloc`, so after the fix in the previous commit, the links
instead went to `alloc/collections/index.html`, which has almost no
information.

This changes it to link to `index.html`, which only works when viewing
from `std::collections::BTreeMap`, the most common place to visit the
docs. Fixing it to work from anywhere would require the docs for
`std::collections` to be duplicated in `alloc::collections`, which in
turn would require HashMap to be `alloc` for intra-doc links to work
(#74481).
  • Loading branch information
jyn514 committed Sep 27, 2020
1 parent 8437d7b commit 4065846
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// types that can be `==` without being identical. See the [module-level
/// documentation] for more.
///
/// [module-level documentation]: crate::collections#insert-and-complex-keys
/// [module-level documentation]: index.html#insert-and-complex-keys
///
/// # Examples
///
Expand Down

0 comments on commit 4065846

Please sign in to comment.