Uh oh!
There was an error while loading. Please reload this page.
Add checked operation methods to Duration - #36463
Conversation
rust-highfive
commented
Sep 14, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
sfackler
commented
Sep 14, 2016
Can we update the |
| } | ||
| } | ||
| /// Checked integer multiplication. Computes `self * other`, returning |
@sfackler What's the best way to do that? Only catch I can see is Edit: To clarify, my question is specifically: do we care about the |
sfackler
commented
Sep 14, 2016
It looks like they only fail due to overflow, so you should just be able to do something like fnadd(self,other:Duration) -> Duration{self.checked_add(other).expect("overflow when adding durations")} |
eugene-bulkin
commented
Sep 14, 2016
So how about this:
Are those reasonable? Or are the last two too wordy? |
sfackler
commented
Sep 14, 2016
Those all seem reasonable. I wouldn't worry too much about the wordyness - people hopefully shouldn't be seeing them very often :) |
eugene-bulkin
commented
Sep 14, 2016
Looks like doc-tests are failing. I'll get those fixed ASAP. |
alexcrichton
commented
Sep 14, 2016
Looks good to me! r=me when the tests are passing |
eugene-bulkin
commented
Sep 15, 2016
Doc-tests failing now because I marked the functions as unstable. Should I leave the marked as unstable and add the |
sfackler
commented
Sep 15, 2016
You should add the attributes in the examples. |
alexcrichton
commented
Sep 15, 2016
@bors: r+ Thanks! |
bors
commented
Sep 15, 2016
📌 Commit b6321bd has been approved by |
… r=alexcrichton Add checked operation methods to Duration Addresses rust-lang#35774.
Addresses #35774.