Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deer: implement Deserialize for core::time #2390

Merged
merged 15 commits into from
Apr 14, 2023
Merged

deer: implement Deserialize for core::time #2390

merged 15 commits into from
Apr 14, 2023

Conversation

indietyp
Copy link
Member

🌟 What is the purpose of this PR?

Implements Deserialize for:

Based on #2376, due to new assertion function used for relative equality.

🔗 Related links

🔍 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)
  • modifies a Cargo-publishable library and I have amended the version
  • modifies a Cargo-publishable library, but it is not yet ready to publish
  • modifies a block that will need publishing via GitHub action once merged
  • does not modify any publishable blocks or libraries
  • I am unsure / need advice

@codecov
Copy link

codecov bot commented Apr 10, 2023

Codecov Report

Merging #2390 (31d502e) into main (3bf4fa1) will increase coverage by 4.13%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2390      +/-   ##
==========================================
+ Coverage   56.77%   60.90%   +4.13%     
==========================================
  Files         337      318      -19     
  Lines       26015    24233    -1782     
  Branches      421      421              
==========================================
- Hits        14769    14760       -9     
+ Misses      11241     9468    -1773     
  Partials        5        5              
Flag Coverage Δ
backend-integration-tests 3.66% <ø> (ø)
deer 69.31% <100.00%> (+0.07%) ⬆️
unit-tests 1.49% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
libs/deer/src/impls/core/time.rs 100.00% <100.00%> (ø)

... and 34 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Base automatically changed from bm/deer/core-cell to main April 13, 2023 12:30
Copy link
Contributor

@thehabbos007 thehabbos007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks fine, just have a smol question :)

let input = value.as_secs_f64();

assert_tokens_with_assertion(|received: Duration| {
assert_relative_eq!(received.as_secs_f64(), value.as_secs_f64());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is approx used in future implementations? Or can we simply do a - b < f64:EPSILON for f64 comparisons?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope not at all, we can indeed just use a - b < f64:EPSILON. Good catch!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 9048070

@indietyp indietyp enabled auto-merge April 14, 2023 14:39
@indietyp indietyp added this pull request to the merge queue Apr 14, 2023
Merged via the queue into main with commit c5a925c Apr 14, 2023
@indietyp indietyp deleted the bm/deer/core-time branch April 14, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/libs > deer Affects the `deer` crate (library)
Development

Successfully merging this pull request may close these issues.

None yet

2 participants