Skip to content

Commit

Permalink
Clearly state error trait limitation in docstring of error types
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed May 31, 2024
1 parent 9ccead5 commit f19d9a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ pub const fn primes_geq<const N: usize, const MEM: usize>(

/// The error returned by [`primes_lt`] and [`primes_geq`] if the input
/// is invalid or does not work to produce the requested primes.
///
/// Only implements the [`Error`](std::error::Error) trait
/// if the `std` feature is enabled.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum GenerationError {
/// The limit was larger than or equal to `MEM^2`.
Expand Down
3 changes: 3 additions & 0 deletions src/sieve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ pub const fn sieve<const N: usize>() -> [bool; N] {

/// The error returned by [`sieve_lt`] and [`sieve_geq`] if the input
/// is invalid or does not work to sieve the requested range.
///
/// Only implements the [`Error`](std::error::Error) trait
/// if the `std` feature is enabled.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SieveError {
/// The limit was less than or equal to `N` (for `sieve_lt`).
Expand Down

0 comments on commit f19d9a5

Please sign in to comment.