Closed naskya closed 4 months ago
Thanks for the contribution! Would you mind removing the unused import causing the CI to fail? I don't think this is actually from your changes, but either way it would be nice to fix while we're here.
Okay! I applied the fixes suggested by cargo clippy
.
Clippy also warned me that this response
is ()
because send
returns Result<(), WebPushError>
which comes from request_builder::parse_response
.
Part of me wonders if this is unintentional and you may actually want to return http::Response
rather than ()
, but a function in the unit test implies this is intentional, so I’m not quite sure how I should fix this.
Having said that, changing the return value of a function would cause a breaking change, and it may be too much to address that warning in this single merge request, so I personally think we should ignore it for now.
Yeah, I agree. I think it's a reasonable pattern to use to just use a Result with a Unit in the Ok when you only want to indicate an error, but the way the code is used here is odd. Given the functions docs and the unit test it does look like this is intential, and the function is just used to check for bad HTTP codes. Not ideal, but pretty niche tbh given how this library is normally used.
Now that all the CI passes, I'll merge this in. Thanks for the help again!