{"action":"created","issue":{"url":"https://api.github.com/repos/bluss/rust-itertools/issues/174","repository_url":"https://api.github.com/repos/bluss/rust-itertools","labels_url":"https://api.github.com/repos/bluss/rust-itertools/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/bluss/rust-itertools/issues/174/comments","events_url":"https://api.github.com/repos/bluss/rust-itertools/issues/174/events","html_url":"https://github.com/bluss/rust-itertools/issues/174","id":194119262,"number":174,"title":"Do not assert(n == 0) in combinations and return empty iterator instead","user":{"login":"nagisa","id":679122,"avatar_url":"https://avatars.githubusercontent.com/u/679122?v=3","gravatar_id":"","url":"https://api.github.com/users/nagisa","html_url":"https://github.com/nagisa","followers_url":"https://api.github.com/users/nagisa/followers","following_url":"https://api.github.com/users/nagisa/following{/other_user}","gists_url":"https://api.github.com/users/nagisa/gists{/gist_id}","starred_url":"https://api.github.com/users/nagisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nagisa/subscriptions","organizations_url":"https://api.github.com/users/nagisa/orgs","repos_url":"https://api.github.com/users/nagisa/repos","events_url":"https://api.github.com/users/nagisa/events{/privacy}","received_events_url":"https://api.github.com/users/nagisa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-07T17:50:45Z","updated_at":"2016-12-07T17:55:21Z","closed_at":null,"body":"Consider a case like this:\r\n\r\n```\r\nit.flat_map(|v| (0..v).combinations(x))\r\n```\r\n\r\nThis iterator panics if `it` happens to yield a `0`. I feel like it would be much more convenient if the combinations iterator just didn’t yield anything (i.e. was the same as an iterator that always yields None)."},"comment":{"url":"https://api.github.com/repos/bluss/rust-itertools/issues/comments/265520683","html_url":"https://github.com/bluss/rust-itertools/issues/174#issuecomment-265520683","issue_url":"https://api.github.com/repos/bluss/rust-itertools/issues/174","id":265520683,"user":{"login":"bluss","id":3209739,"avatar_url":"https://avatars.githubusercontent.com/u/3209739?v=3","gravatar_id":"","url":"https://api.github.com/users/bluss","html_url":"https://github.com/bluss","followers_url":"https://api.github.com/users/bluss/followers","following_url":"https://api.github.com/users/bluss/following{/other_user}","gists_url":"https://api.github.com/users/bluss/gists{/gist_id}","starred_url":"https://api.github.com/users/bluss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluss/subscriptions","organizations_url":"https://api.github.com/users/bluss/orgs","repos_url":"https://api.github.com/users/bluss/repos","events_url":"https://api.github.com/users/bluss/events{/privacy}","received_events_url":"https://api.github.com/users/bluss/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T17:55:21Z","updated_at":"2016-12-07T17:55:21Z","body":"Your example code is showing the input iterator being empty (`0..v` with `v = 0`) if I understand correctly, and combinations is already yielding `None` there."}}
{"actor":{"display_login":"bluss"}}