1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 21:17:46 +00:00

factor::miller_rabbin::Result: Mark as #[must_use]

Ignoring a value of that type is a bug: they are only produced by
`miller_rabbin::test`, which is a pure, but expensive, function.

As such, an ignored value is always either a mistake, or an easy
optimisation opportunity (just remove the useless call to `test`).
This commit is contained in:
nicoo 2020-07-17 12:54:37 +02:00
parent ecc3e2db24
commit 3e55139c13

View file

@ -25,6 +25,7 @@ impl Basis for Montgomery<u32> {
} }
#[derive(Eq, PartialEq)] #[derive(Eq, PartialEq)]
#[must_use = "Ignoring the output of a primality test."]
pub(crate) enum Result { pub(crate) enum Result {
Prime, Prime,
Pseudoprime, Pseudoprime,