{"action":"opened","issue":{"url":"https://api.github.com/repos/input-output-hk/rust-cardano/issues/313","repository_url":"https://api.github.com/repos/input-output-hk/rust-cardano","labels_url":"https://api.github.com/repos/input-output-hk/rust-cardano/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/input-output-hk/rust-cardano/issues/313/comments","events_url":"https://api.github.com/repos/input-output-hk/rust-cardano/issues/313/events","html_url":"https://github.com/input-output-hk/rust-cardano/issues/313","id":376932550,"node_id":"MDU6SXNzdWUzNzY5MzI1NTA=","number":313,"title":"Surprising operator overloads for Coin","user":{"login":"mzabaluev","id":1198919,"node_id":"MDQ6VXNlcjExOTg5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/1198919?v=4","gravatar_id":"","url":"https://api.github.com/users/mzabaluev","html_url":"https://github.com/mzabaluev","followers_url":"https://api.github.com/users/mzabaluev/followers","following_url":"https://api.github.com/users/mzabaluev/following{/other_user}","gists_url":"https://api.github.com/users/mzabaluev/gists{/gist_id}","starred_url":"https://api.github.com/users/mzabaluev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzabaluev/subscriptions","organizations_url":"https://api.github.com/users/mzabaluev/orgs","repos_url":"https://api.github.com/users/mzabaluev/repos","events_url":"https://api.github.com/users/mzabaluev/events{/privacy}","received_events_url":"https://api.github.com/users/mzabaluev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-02T19:03:46Z","updated_at":"2018-11-02T19:03:46Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The impls of `std::ops` arithmetic operator traits for `Coin` have a `Result` type as the output. This somewhat defeats the purpose of operator overloading by encumbering the notation with mandatory result checking, and violates an [API guideline][c-overload] on operator overloading acting predictably.\r\n\r\nA more conventional solution for checked math would be methods on `Coin`, similar to the `checked_*` [methods][checked] found on built-in integer types.\r\n\r\n[c-overload]: https://rust-lang-nursery.github.io/api-guidelines/predictability.html#operator-overloads-are-unsurprising-c-overload\r\n[checked]: https://doc.rust-lang.org/std/primitive.u64.html#method.checked_add"}}
{"actor":{"display_login":"mzabaluev"}}