From 11194667f0fee3453da326525b5ac29483f7a04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johanna=20S=C3=B6rng=C3=A5rd?= Date: Wed, 13 Nov 2024 17:09:36 +0100 Subject: [PATCH] Correct docstring of new function and update log --- CHANGELOG.md | 1 + src/cache/mod.rs | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 277e67d..cd53af5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ This file contains the changes to the crate since version 0.4.8. ## 0.9.1 - Correct docstring of `Primes::default`. +- COrrect docstring of `Primes::new`. ## 0.9.0 diff --git a/src/cache/mod.rs b/src/cache/mod.rs index 5b736ef..0442cce 100644 --- a/src/cache/mod.rs +++ b/src/cache/mod.rs @@ -88,18 +88,12 @@ impl Primes { /// assert_eq!(primes.as_array(), &[2, 3, 5, 7, 11]); /// ``` /// - /// # Panics - /// - /// Panics if `N` is 0, which is a compile error in const contexts: + /// It is a compile error to use an `N` of 0. /// /// ```compile_fail /// # use const_primes::Primes; /// const NO_PRIMES: Primes<0> = Primes::new(); /// ``` - /// - /// This is always a compile error instead of a panic if the `const_assert` feature is enabled. - /// - /// If any of the primes overflow a `u32` it will panic in const contexts or debug mode. #[must_use = "the associated method only returns a new value"] pub const fn new() -> Self { const { assert!(N > 0, "`N` must be at least 1") }