morukele / paystack-rs

An open-source rust library for using the PayStack API
https://crates.io/crates/paystack-rs
MIT License
13 stars 5 forks source link

Changed control flow for error handling of the client to match statement #7

Closed morukele closed 11 months ago

morukele commented 11 months ago

In this pull request, I changed the error handling for the API client to match-statements instead of if-statements. The logic for the change is that the match-statement allow the API client to handle the successful results expected from the API properly and then treat all other results as an API error, this also reduces the risk of not capturing some edge cases with the if-statement.