factor::Factors::add: Split up to work without NLL
@@ -44,7 +44,8 @@ impl Factors {
fn add(&mut self, prime: u64, exp: u8) {
assert!(exp > 0);
- self.f.insert(prime, exp + self.f.get(&prime).unwrap_or(&0));
+ let n = *self.f.get(&prime).unwrap_or(&0);
+ self.f.insert(prime, exp + n);
}
fn push(&mut self, prime: u64) {
