Skip to content

Instantly share code, notes, and snippets.

@panicbit
Last active August 29, 2015 14:26
Show Gist options
  • Save panicbit/75b47428038acbb9332d to your computer and use it in GitHub Desktop.
Save panicbit/75b47428038acbb9332d to your computer and use it in GitHub Desktop.
let mut request = ...;
match request.dispatch() {
// On auth errors, dispatch request again
Err(RequestError::Auth) => request.dispatch(),
// Ignore other errors
request => request
};
error: cannot borrow `request` as mutable more than once at a time
Err(RequestError::Auth) => request.dispatch(),
^~~~~~~
note: previous borrow of `request` occurs here; the mutable borrow prevents subsequent moves, borrows, or modification of `request` until the borrow ends
match request.dispatch() {
^~~~~~~
note: previous borrow ends here
match request.dispatch() {
// On auth errors, dispatch request again
Err(RequestError::Auth) => request.dispatch(),
// Ignore other errors
request => request
};
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment