Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Fix doc_markdown lints in bevy_utils #3485

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions crates/bevy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ impl std::hash::BuildHasher for FixedState {
}
}

/// A [`HashMap`][std::collections::HashMap] implementing [aHash][aHash], a high
/// A [`HashMap`][std::collections::HashMap] implementing [`aHash`], a high
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this link still works? I think cargo-doc would try to render it as an indoc link rather than the external link referenced by [aHash]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! I double checked, it still works. If the link text itself is identical to the link specifier you don't have to write it twice.

Copy link
Contributor Author

@mfdorst mfdorst Dec 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we don't have anything named aHash for it to conflict with.

/// speed keyed hashing algorithm intended for use in in-memory hashmaps.
///
/// AHash is designed for performance and is NOT cryptographically secure.
/// `aHash` is designed for performance and is NOT cryptographically secure.
///
/// # Construction
///
Expand Down Expand Up @@ -68,15 +68,15 @@ impl std::hash::BuildHasher for FixedState {
/// # }
/// ```
///
/// [aHash]: https://github.com/tkaitchuck/aHash
/// [`aHash`]: https://github.com/tkaitchuck/aHash
pub type HashMap<K, V> = std::collections::HashMap<K, V, RandomState>;

pub trait AHashExt {
fn with_capacity(capacity: usize) -> Self;
}

impl<K, V> AHashExt for HashMap<K, V> {
/// Creates an empty `HashMap` with the specified capacity with AHash.
/// Creates an empty `HashMap` with the specified capacity with aHash.
///
/// The hash map will be able to hold at least `capacity` elements without
/// reallocating. If `capacity` is 0, the hash map will not allocate.
Expand All @@ -94,17 +94,17 @@ impl<K, V> AHashExt for HashMap<K, V> {
}
}

/// A stable std hash map implementing AHash, a high speed keyed hashing algorithm
/// A stable std hash map implementing `aHash`, a high speed keyed hashing algorithm
/// intended for use in in-memory hashmaps.
///
/// Unlike [`HashMap`] this has an iteration order that only depends on the order
/// of insertions and deletions and not a random source.
///
/// AHash is designed for performance and is NOT cryptographically secure.
/// `aHash` is designed for performance and is NOT cryptographically secure.
pub type StableHashMap<K, V> = std::collections::HashMap<K, V, FixedState>;

impl<K, V> AHashExt for StableHashMap<K, V> {
/// Creates an empty `StableHashMap` with the specified capacity with AHash.
/// Creates an empty `StableHashMap` with the specified capacity with `aHash`.
///
/// The hash map will be able to hold at least `capacity` elements without
/// reallocating. If `capacity` is 0, the hash map will not allocate.
Expand All @@ -122,10 +122,10 @@ impl<K, V> AHashExt for StableHashMap<K, V> {
}
}

/// A [`HashSet`][std::collections::HashSet] implementing [aHash][aHash], a high
/// A [`HashSet`][std::collections::HashSet] implementing [`aHash`], a high
/// speed keyed hashing algorithm intended for use in in-memory hashmaps.
///
/// AHash is designed for performance and is NOT cryptographically secure.
/// `aHash` is designed for performance and is NOT cryptographically secure.
///
/// # Construction
///
Expand Down Expand Up @@ -158,11 +158,11 @@ impl<K, V> AHashExt for StableHashMap<K, V> {
/// # }
/// ```
///
/// [aHash]: https://github.com/tkaitchuck/aHash
/// [`aHash`]: https://github.com/tkaitchuck/aHash
pub type HashSet<K> = std::collections::HashSet<K, RandomState>;

impl<K> AHashExt for HashSet<K> {
/// Creates an empty `HashSet` with the specified capacity with AHash.
/// Creates an empty `HashSet` with the specified capacity with aHash.
///
/// The hash set will be able to hold at least `capacity` elements without
/// reallocating. If `capacity` is 0, the hash set will not allocate.
Expand All @@ -180,17 +180,17 @@ impl<K> AHashExt for HashSet<K> {
}
}

/// A stable std hash set implementing AHash, a high speed keyed hashing algorithm
/// A stable std hash set implementing `aHash`, a high speed keyed hashing algorithm
/// intended for use in in-memory hashmaps.
///
/// Unlike [`HashSet`] this has an iteration order that only depends on the order
/// of insertions and deletions and not a random source.
///
/// AHash is designed for performance and is NOT cryptographically secure.
/// `aHash` is designed for performance and is NOT cryptographically secure.
pub type StableHashSet<K> = std::collections::HashSet<K, FixedState>;

impl<K> AHashExt for StableHashSet<K> {
/// Creates an empty `StableHashSet` with the specified capacity with AHash.
/// Creates an empty `StableHashSet` with the specified capacity with `aHash`.
///
/// The hash set will be able to hold at least `capacity` elements without
/// reallocating. If `capacity` is 0, the hash set will not allocate.
Expand Down