{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/455","repository_url":"https://api.github.com/repos/rust-lang-nursery/rand","labels_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/455/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/455/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/455/events","html_url":"https://github.com/rust-lang-nursery/rand/issues/455","id":323258604,"number":455,"title":"Remove Distribution::sample_iter","user":{"login":"sicking","id":1831914,"avatar_url":"https://avatars2.githubusercontent.com/u/1831914?v=4","gravatar_id":"","url":"https://api.github.com/users/sicking","html_url":"https://github.com/sicking","followers_url":"https://api.github.com/users/sicking/followers","following_url":"https://api.github.com/users/sicking/following{/other_user}","gists_url":"https://api.github.com/users/sicking/gists{/gist_id}","starred_url":"https://api.github.com/users/sicking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sicking/subscriptions","organizations_url":"https://api.github.com/users/sicking/orgs","repos_url":"https://api.github.com/users/sicking/repos","events_url":"https://api.github.com/users/sicking/events{/privacy}","received_events_url":"https://api.github.com/users/sicking/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-15T15:03:05Z","updated_at":"2018-05-15T15:28:02Z","closed_at":null,"author_association":"NONE","body":"I might be misunderstanding the purpose of `Distribution::sample_iter`, in which case feel free to close this issue.\r\n\r\nBest I can tell, the `Distribution::sample_iter` function is not useful. Implementations of the `Distribution` trait are required to still return a `DistIter` struct, which means that the only sensible implementation of `Distribution::sample_iter` is to use the default implementation.\r\n\r\nSo we might as well move the implementation of `Distribution::sample_iter` into `Rng::sample_iter` and get rid of `Distribution::sample_iter`.\r\n\r\nThis is arguably somewhat similar to issue 451, in that we currently have two ways of creating an iterator, `Uniform::new(1, 30).sample_iter(rng)` and `rng.sample_iter(Uniform::new(1, 30))`, whereas it seems having one would be better.\r\n\r\nI'm happy to create a pull request if there's agreement."},"comment":{"url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/comments/389209174","html_url":"https://github.com/rust-lang-nursery/rand/issues/455#issuecomment-389209174","issue_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/455","id":389209174,"user":{"login":"dhardy","id":134893,"avatar_url":"https://avatars1.githubusercontent.com/u/134893?v=4","gravatar_id":"","url":"https://api.github.com/users/dhardy","html_url":"https://github.com/dhardy","followers_url":"https://api.github.com/users/dhardy/followers","following_url":"https://api.github.com/users/dhardy/following{/other_user}","gists_url":"https://api.github.com/users/dhardy/gists{/gist_id}","starred_url":"https://api.github.com/users/dhardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhardy/subscriptions","organizations_url":"https://api.github.com/users/dhardy/orgs","repos_url":"https://api.github.com/users/dhardy/repos","events_url":"https://api.github.com/users/dhardy/events{/privacy}","received_events_url":"https://api.github.com/users/dhardy/received_events","type":"User","site_admin":false},"created_at":"2018-05-15T15:28:02Z","updated_at":"2018-05-15T15:28:02Z","author_association":"COLLABORATOR","body":"You mean not useful the way functions like `Iterator::count` are trivial to implement and have no sensible implementation besides the default? Or just because there are two functions for the same thing?\r\n\r\nI agree with @pitdicker, in part because of symmetry with `Rng::sample` and `Distribution::sample`. It's weird for sure, but there's isn't really a good alternative I don't think (even the old `Rand` could be used in two ways)."}}
{"actor":{"display_login":"dhardy"}}