Skip to content

Commit

Permalink
Correct docstring of new function and update log
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed Nov 13, 2024
1 parent bfe5e0f commit 1119466
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This file contains the changes to the crate since version 0.4.8.
## 0.9.1

- Correct docstring of `Primes<N>::default`.
- COrrect docstring of `Primes<N>::new`.

## 0.9.0

Expand Down
8 changes: 1 addition & 7 deletions src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,12 @@ impl<const N: usize> Primes<N> {
/// 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") }
Expand Down

0 comments on commit 1119466

Please sign in to comment.