diff --git a/Cargo.toml b/Cargo.toml index e333017a..137e6473 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,13 @@ edition = "2024" rust-version = "1.85" exclude = ["/.github"] +[lints.rust] +missing_docs = "warn" +missing_debug_implementations = "warn" + +[lints.clippy] +undocumented_unsafe_blocks = "warn" + [package.metadata.docs.rs] # To build locally: # cargo +nightly doc --open diff --git a/src/lib.rs b/src/lib.rs index 4d656816..d3c55d92 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,11 +7,6 @@ html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico" )] -#![deny( - missing_docs, - missing_debug_implementations, - clippy::undocumented_unsafe_blocks -)] use core::ops::DerefMut; diff --git a/src/utils.rs b/src/utils.rs index f402294f..75e184da 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -34,6 +34,9 @@ //! In many cases, [`SeedableRng::Seed`] must be converted to `[u32; _]` or //! `[u64; _]`. [`read_words`] may be used for this. //! +//! [`SeedableRng`]: crate::SeedableRng +//! [`SeedableRng::Seed`]: crate::SeedableRng::Seed +//! //! ## Example //! //! We demonstrate a simple multiplicative congruential generator (MCG), taken @@ -83,9 +86,8 @@ //! # assert_eq!(buf, [154, 23, 43, 68, 75]); //! ``` +use crate::TryRng; pub use crate::word::Word; -#[allow(unused)] -use crate::{SeedableRng, TryRng}; /// Generate a `u64` using `next_u32`, little-endian order. #[inline] diff --git a/tests/block.rs b/tests/block.rs index d9e18137..ef818183 100644 --- a/tests/block.rs +++ b/tests/block.rs @@ -1,3 +1,4 @@ +//! Tests for the `block` module items use rand_core::{ SeedableRng, block::{BlockRng, Generator}, diff --git a/tests/mod.rs b/tests/mod.rs index 2c60966e..68c41ac7 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -1,3 +1,4 @@ +//! Main `rand_core` tests use rand_core::{CryptoRng, Infallible, Rng, SeedableRng, TryCryptoRng, TryRng, UnwrapErr, utils}; #[test] diff --git a/tests/utils.rs b/tests/utils.rs index d6ae9a89..dce6a4bc 100644 --- a/tests/utils.rs +++ b/tests/utils.rs @@ -1,3 +1,4 @@ +//! Tests for the `utils` module items use rand_core::{Infallible, Rng, TryRng, utils}; struct DummyRng(u32);