Last active
August 29, 2015 14:26
-
-
Save panicbit/75b47428038acbb9332d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut request = ...; | |
match request.dispatch() { | |
// On auth errors, dispatch request again | |
Err(RequestError::Auth) => request.dispatch(), | |
// Ignore other errors | |
request => request | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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