From 9b0f13113530f79ecd84087150d0c23a9764708e Mon Sep 17 00:00:00 2001 From: nicoo Date: Sat, 4 Jul 2020 12:56:25 +0200 Subject: [PATCH] Fix bug in factor::factor::factor (>_>") Non-prime numbers, such as 0 or 1, shouldn't be inserted in the factorisation. --- src/uu/factor/src/factor.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/uu/factor/src/factor.rs b/src/uu/factor/src/factor.rs index a27c86c62..1e4e4087b 100644 --- a/src/uu/factor/src/factor.rs +++ b/src/uu/factor/src/factor.rs @@ -86,7 +86,6 @@ pub fn factor(mut n: u64) -> Factors { let mut factors = Factors::one(); if n < 2 { - factors.push(n); return factors; }