-
Notifications
You must be signed in to change notification settings - Fork 43
fix(binding):overflow of StoreUint64 trait, modify foo_ to inner_foo #251
Conversation
Accept request. |
Accept request. |
Docker builded. "mutadev/muta:aa3c7a7" |
|
Accept request. |
Docker builded. "mutadev/muta:83d59ac" |
Accept request. |
} | ||
} | ||
} | ||
|
||
impl<S: ServiceState> StoreUint64 for DefaultStoreUint64<S> { | ||
fn get(&self) -> u64 { | ||
self.get_() | ||
.unwrap_or_else(|e| panic!("StoreUint64 get failed: {}", e)) | ||
self.inner_get() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove fn inner_xx
method, and move the logic to fn xx
trait method.
The reason of inner_xx
existed is historical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but refactoring may not be included here because the focus of this PR is to solve the overflow.
Docker builded. "mutadev/muta:0b0c6d8" |
protocol/src/traits/binding.rs
Outdated
@@ -234,27 +234,27 @@ pub trait StoreUint64 { | |||
|
|||
// Add val with self | |||
// And set the result back to self | |||
fn add(&mut self, val: u64); | |||
fn add(&mut self, val: u64) -> bool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about name the method fn safe_xx
?
Because we had took care of math overflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think right
Accept request. |
Docker builded. "mutadev/muta:c2995d9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for the four-node test to finish.
|
Accept request. |
Docker builded. "mutadev/muta:c4da9fd" |
Accept request. |
Docker builded. "mutadev/muta:e996965" |
|
What type of PR is this?
bug
What this PR does / why we need it:
fix bug of StoreUint64 overflow panic
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: