Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. error[E0596]: cannot borrow data in a `&` reference as mutable
  2. --> src/main.rs:72:13
  3. |
  4. 72 | income_list.push( 1);
  5. | ^^^^^^^^^^^ cannot borrow as mutable
  6.  
  7. lazy_static! {
  8. static ref expense_list: Vec<i64> = Vec::new();
  9. static ref income_list: Vec<u64> = Vec::new();
  10. }
  11.  
  12. let mut income_input = String::new();
  13. io::stdin().read_line(&mut income_input);
  14. let mut income_input: u64 = match income_input.trim().parse() {
  15. Ok(num) => num,
  16. Err(_) => break,
  17. };
  18. income_list.push(1); // it was income_list.push(income_input)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement