-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make retriable request functions
Fn
instead of FnMut
At the time I wrote this code I didn't realize that plain `Fn` existed and thought the only two options were `FnOnce` (which I couldn't use since the function is called more than once) and the previously used `FnMut`. This brought the problem that, because the function could mutate state (which we never used outside of the tests), it had to be wrapped in an `Arc<Mutex<_>>`, which was quite ugly. This makes the tests a tad messier since they have to use synchronized operations to keep track of the attempt count now, but it's not too bad and isolated solely to the test code. Signed-off-by: Ryan Gonzalez <[email protected]>
- Loading branch information
1 parent
dc5787d
commit 7749b37
Showing
1 changed file
with
25 additions
and
29 deletions.
There are no files selected for viewing
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