Because of all the cloning, I decided to flip it to be Arc<Box> instead of Box<Arc>.
I see three solutions here.
The one I'd lean towards is Arc<Arc> even if it's a bit silly, but prevents extra unnecessary allocations on each request.
An alternative is to implement Middleware for Arc and then you can use the regular with(...) api. This would mean there's an extra box around your middleware
Revert this particular change
In the short term, I think it's best to go with option 3. This will unblock the next release. We can consider the other options for future releases.
fixes #139 related https://github.com/TrueLayer/reqwest-middleware/pull/135
There are other potential long term solutions listed here
In the short term, I think it's best to go with option 3. This will unblock the next release. We can consider the other options for future releases.