Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

17: My Solution requires mut tx. #57

Closed
cldershem opened this issue Oct 16, 2017 · 0 comments
Closed

17: My Solution requires mut tx. #57

cldershem opened this issue Oct 16, 2017 · 0 comments

Comments

@cldershem
Copy link
Contributor

The borrow checker does not seem happy as is.

error[E0596]: cannot borrow immutable local variable `rx` as mutable
  --> src/main.rs:30:21
   |
27 |     let Serial { tx, rx } = Serial::new().unwrap();
   |                      -- consider changing this to `mut rx`
...
30 |     let mut bytes = rx.bytes();
   |                     ^^ cannot borrow mutably

error[E0596]: cannot borrow immutable local variable `tx` as mutable
  --> src/main.rs:45:13
   |
27 |     let Serial { tx, rx } = Serial::new().unwrap();
   |                  -- consider changing this to `mut tx`
...
45 |             tx.write(byte).wait();
   |             ^^ cannot borrow mutably
error: aborting due to 2 previous errors
error: Could not compile `async`.
To learn more, run the command again with --verbose.
cldershem added a commit to cldershem/discovery that referenced this issue Oct 16, 2017
The borrow checker would like mutable references. Closes rust-embedded#57.
japaric pushed a commit that referenced this issue Oct 17, 2017
Requires mutable references.

The borrow checker would like mutable references. Closes #57.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant