From 3e55139c13a55c74b734681cac178ad195a36222 Mon Sep 17 00:00:00 2001 From: nicoo Date: Fri, 17 Jul 2020 12:54:37 +0200 Subject: [PATCH] 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`). --- src/uu/factor/src/miller_rabin.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/uu/factor/src/miller_rabin.rs b/src/uu/factor/src/miller_rabin.rs index ad454f1ac..3d12ead02 100644 --- a/src/uu/factor/src/miller_rabin.rs +++ b/src/uu/factor/src/miller_rabin.rs @@ -25,6 +25,7 @@ impl Basis for Montgomery { } #[derive(Eq, PartialEq)] +#[must_use = "Ignoring the output of a primality test."] pub(crate) enum Result { Prime, Pseudoprime,