Advertisement
fivemack

Untitled

Mar 28th, 2023
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. while let Some(Reverse(p)) = bh_ascending.peek()
  2. {
  3. if p.sum == ls
  4. {
  5. lefts.push(p);
  6. self.pop_ascending(&mut bh_ascending);
  7. }
  8. }
  9.  
  10.  
  11. error[E0502]: cannot borrow `bh_ascending` as mutable because it is also borrowed as immutable
  12. --> src/knapsack.rs:94:44
  13. |
  14. 89 | while let Some(Reverse(p)) = bh_ascending.peek()
  15. | ------------------- immutable borrow occurs here
  16. ...
  17. 93 | lefts.push(p);
  18. | ------------- immutable borrow later used here
  19. 94 | self.pop_ascending(&mut bh_ascending);
  20. | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement