Wrap rustdocs at a consistent column width of 100
What changed, and why it matters
This commit only reformats documentation comments (rustdocs) so they wrap at 100 characters per line. It changes line breaks and spacing in comments only, with no changes to actual code logic, APIs, or behavior. There is no security relevance.
No action required. This is a non-functional documentation formatting change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit reflows rustdoc paragraph text to a consistent 100-column width across four files in the hashes crate. All changes are inside //! and /// doc comments. No executable code, type signatures, macros, or cryptographic logic was modified. The diff is purely cosmetic documentation formatting.
Changed components
hashes/src/hkdf/mod.rshashes/src/lib.rshashes/src/macros.rshashes/src/sha512_256/mod.rsInspect captured patch +16 / −20
diff --git a/hashes/src/hkdf/mod.rs b/hashes/src/hkdf/mod.rs
index d1326890..a4c06868 100644
--- a/hashes/src/hkdf/mod.rs
+++ b/hashes/src/hkdf/mod.rs
@@ -2,8 +2,7 @@
//! HMAC-based Extract-and-Expand Key Derivation Function (HKDF).
//!
-//! Implementation based on RFC5869, but the interface is scoped
-//! to BIP-0324's requirements.
+//! Implementation based on RFC5869, but the interface is scoped to BIP-0324's requirements.
#[cfg(feature = "alloc")]
use alloc::vec;
diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs
index 5b28c138..d26067d9 100644
--- a/hashes/src/lib.rs
+++ b/hashes/src/lib.rs
@@ -196,8 +196,8 @@ pub trait HashEngine: Clone {
/// Encodes an object into a hash engine.
///
-/// Consumes and returns the hash engine to make it easier to call
-/// [`HashEngine::finalize`] directly on the result.
+/// Consumes and returns the hash engine to make it easier to call [`HashEngine::finalize`] directly
+/// on the result.
pub fn encode_to_engine<T, H>(object: &T, mut engine: H) -> H
where
T: encoding::Encodable + ?Sized,
@@ -256,9 +256,8 @@ mod sealed {
/// Does a best attempt at erasing the contents of `val` by writing zeros.
///
-/// The implementation is based on the approach used by the
-/// [`zeroize`](https://docs.rs/zeroize) crate and the `non_secure_erase` functions in
-/// `rust-secp256k1`.
+/// The implementation is based on the approach used by the [`zeroize`](https://docs.rs/zeroize)
+/// crate and the `non_secure_erase` functions in `rust-secp256k1`.
///
/// Note, however, that the compiler is allowed to freely copy or move the contents of `val` to
/// other places in memory. Preventing this behavior is very subtle. For more discussion on this,
diff --git a/hashes/src/macros.rs b/hashes/src/macros.rs
index 739f9a5c..774317d8 100644
--- a/hashes/src/macros.rs
+++ b/hashes/src/macros.rs
@@ -67,9 +67,9 @@ macro_rules! sha256t_tag {
/// This will display the hash backwards regardless of what the inner type does. Use `forward`
/// instead of `backward` to force displaying forward.
///
-/// You can add arbitrary doc comments or other attributes to the struct or its field. Note that
-/// the macro already derives [`Copy`], [`Clone`], [`Eq`], [`PartialEq`],
-/// [`Hash`](core::hash::Hash), [`Ord`], [`PartialOrd`].
+/// You can add arbitrary doc comments or other attributes to the struct or its field. Note that the
+/// macro already derives:
+/// [`Copy`], [`Clone`], [`Eq`], [`PartialEq`], [`Hash`](core::hash::Hash), [`Ord`], [`PartialOrd`].
///
/// You can also define multiple newtypes within one macro call:
///
@@ -527,8 +527,8 @@ macro_rules! impl_serde_for_newtype {
}
}
-/// Implements `Serialize` and `Deserialize` for a type `$t` which
-/// represents a newtype over a byte-slice over length `$len`.
+/// Implements `Serialize` and `Deserialize` for a type `$t` which represents a newtype over a
+/// byte-slice over length `$len`.
#[doc(hidden)]
#[macro_export]
#[cfg(feature = "serde")]
diff --git a/hashes/src/sha512_256/mod.rs b/hashes/src/sha512_256/mod.rs
index 1ce6f657..1efe00ac 100644
--- a/hashes/src/sha512_256/mod.rs
+++ b/hashes/src/sha512_256/mod.rs
@@ -2,10 +2,9 @@
//! SHA512_256 implementation.
//!
-//! SHA512/256 is a hash function that uses the sha512 algorithm but it truncates
-//! the output to 256 bits. It has different initial constants than sha512 so it
-//! produces an entirely different hash compared to sha512. More information at
-//! <https://eprint.iacr.org/2010/548.pdf>.
+//! SHA512/256 is a hash function that uses the sha512 algorithm but it truncates the output to 256
+//! bits. It has different initial constants than sha512 so it produces an entirely different hash
+//! compared to sha512. More information at <https://eprint.iacr.org/2010/548.pdf>.
use crate::sha512;
@@ -26,10 +25,9 @@ impl Hash {
/// Engine to compute SHA512/256 hash function.
///
-/// SHA512/256 is a hash function that uses the sha512 algorithm but it truncates
-/// the output to 256 bits. It has different initial constants than sha512 so it
-/// produces an entirely different hash compared to sha512. More information at
-/// <https://eprint.iacr.org/2010/548.pdf>.
+/// SHA512/256 is a hash function that uses the sha512 algorithm but it truncates the output to 256
+/// bits. It has different initial constants than sha512 so it produces an entirely different hash
+/// compared to sha512. More information at <https://eprint.iacr.org/2010/548.pdf>.
#[derive(Debug, Clone)]
pub struct HashEngine(sha512::HashEngine);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.