Get sunrise information from openuv#18
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the uv_index type from u8 to f64 across the codebase to allow for more precise weather reporting. It also adds detailed models and tests for the OpenUV API. The review feedback addresses a precision formatting issue in the display logic, corrects inconsistent error messages in test assertions, and fixes a duplicate documentation comment.
|
Thanks for contributing this! The sunrise/sunset data from OpenUV is a great addition and I'm looking forward to seeing it displayed in a follow-on PR. That said, I'd prefer to keep the changes more focused. This PR bundles two distinct things:
Could you split these into separate PRs? Something like:
This makes each change easier to review and reason about independently. The UV precision change in particular touches every provider and deserves its own focused review. Happy to merge a tighter version of this once it's split up. Thanks again for the work! |
76ab18f to
abf75ec
Compare
abf75ec to
671b885
Compare
- Merge duplicate mod test into mod tests, reuse shared fixture - Use assert_eq! for known-exact float values from JSON parsing - Replace is_some() + unwrap() with map() in solar_noon assertion - Remove redundant #![cfg(test)] from tests.rs (main.rs already gates it) - Add trailing newline to openuv_response.json
|
Thanks for the contribution! I went ahead and pushed a cleanup commit on top of this branch:
Looking forward to the display PR! |
This parses the sunrise information from openuv and adds it to a new struct.
I'm adding the structure for sunrise information in this PR to keep it relatively small. I intend on making a follow-on PR for formatting the information.
I suggest squash merging PRs to keep a cleaner commit history.