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

refactor(common): extend CheckedAdd with Rhs and Output #3108

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

xiangjinwu
Copy link
Contributor

What's changed and what's your intention?

num_traits::CheckedAdd requires the rhs and output to be the same as self. std::ops::Add allows them to be different but does not return err. We define our own trait to get the best of both worlds.

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

@codecov
Copy link

codecov bot commented Jun 9, 2022

Codecov Report

Merging #3108 (a28e806) into main (296a86c) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

❗ Current head a28e806 differs from pull request most recent head c763e20. Consider uploading reports for the commit c763e20 to get more accurate results

@@            Coverage Diff             @@
##             main    #3108      +/-   ##
==========================================
- Coverage   73.61%   73.52%   -0.10%     
==========================================
  Files         736      736              
  Lines      101473   101077     -396     
==========================================
- Hits        74704    74321     -383     
+ Misses      26769    26756      -13     
Flag Coverage Δ
rust 73.52% <100.00%> (-0.10%) ⬇️

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

Impacted Files Coverage Δ
src/batch/src/executor/generate_series.rs 78.87% <ø> (ø)
src/common/src/types/chrono_wrapper.rs 80.91% <100.00%> (-0.57%) ⬇️
src/common/src/types/ops.rs 100.00% <100.00%> (ø)
src/expr/src/vector_op/arithmetic_op.rs 78.57% <100.00%> (ø)
src/frontend/src/planner/relation.rs 76.00% <0.00%> (-16.81%) ⬇️
src/frontend/src/binder/expr/function.rs 79.47% <0.00%> (-1.52%) ⬇️
src/frontend/src/binder/relation/mod.rs 85.61% <0.00%> (-1.01%) ⬇️
src/stream/src/executor/test_utils.rs 90.41% <0.00%> (-0.84%) ⬇️
src/storage/src/table/cell_based_table.rs 69.91% <0.00%> (-0.56%) ⬇️
src/batch/src/task/task_manager.rs 71.42% <0.00%> (-0.56%) ⬇️
... and 35 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@xiangjinwu xiangjinwu marked this pull request as ready for review June 9, 2022 10:30
TODO: `CheckedAdd<&S> for &T` rather than `CheckedAdd<S> for T`
@xiangjinwu xiangjinwu enabled auto-merge (squash) June 9, 2022 15:49
@xiangjinwu xiangjinwu merged commit 4ffe791 into main Jun 9, 2022
@xiangjinwu xiangjinwu deleted the rust-temporal-checked-add branch June 9, 2022 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants