{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/2543","repository_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy","labels_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/2543/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/2543/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/issues/2543/events","html_url":"https://github.com/rust-lang-nursery/rust-clippy/issues/2543","id":306184640,"number":2543,"title":"Suggestion: Replace `d.subsec_nanos() / 1_000_000` with `d.subsec_millis()`","user":{"login":"kennytm","id":103023,"avatar_url":"https://avatars1.githubusercontent.com/u/103023?v=4","gravatar_id":"","url":"https://api.github.com/users/kennytm","html_url":"https://github.com/kennytm","followers_url":"https://api.github.com/users/kennytm/followers","following_url":"https://api.github.com/users/kennytm/following{/other_user}","gists_url":"https://api.github.com/users/kennytm/gists{/gist_id}","starred_url":"https://api.github.com/users/kennytm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennytm/subscriptions","organizations_url":"https://api.github.com/users/kennytm/orgs","repos_url":"https://api.github.com/users/kennytm/repos","events_url":"https://api.github.com/users/kennytm/events{/privacy}","received_events_url":"https://api.github.com/users/kennytm/received_events","type":"User","site_admin":false},"labels":[{"id":246558520,"url":"https://api.github.com/repos/rust-lang-nursery/rust-clippy/labels/L-lint","name":"L-lint","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-17T19:41:39Z","updated_at":"2018-03-17T19:41:39Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"rust-lang/rust#46507 may soon be stabilized. Code that computes the milliseconds/microseconds-part of a duration could use the `.subsec_millis()`/`.subsec_micros()` methods directly instead of going through a computation with lots of zeros. Clippy should add a lint for the following patterns:\r\n\r\n| Old | New |\r\n|-----|-----|\r\n| `dur.subsec_nanos() / 1_000_000` | `dur.subsec_millis()` |\r\n| `dur.subsec_nanos() / 1_000` | `dur.subsec_micros()` |\r\n\r\nThis mainly helps modernizing existing code.\r\n"}}
{"actor":{"display_login":"kennytm"}}