Skip to content

Commit

Permalink
should split is not closure
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-prosser committed Jul 26, 2024
1 parent 7bd0da4 commit bdc98a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,14 +1315,14 @@ impl Client {
let result: Result<SuccessT> =
self.request(&method, &url, &Some(body.clone()), &query, &retry);

let should_split = |error: &Error| {
fn should_split(error: &Error) -> bool {
if let Error::Api { status_code, .. } = error {
*status_code == reqwest::StatusCode::UNPROCESSABLE_ENTITY
|| *status_code == reqwest::StatusCode::BAD_REQUEST
} else {
false
}
};
}

match result {
Ok(response) => Ok(SplitableRequestResponse {
Expand Down

0 comments on commit bdc98a6

Please sign in to comment.