{"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":[{"id":452761845,"url":"https://api.github.com/repos/bluss/rust-itertools/labels/break-next-version","name":"break-next-version","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-07T17:50:45Z","updated_at":"2016-12-07T18:07:28Z","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/265524339","html_url":"https://github.com/bluss/rust-itertools/issues/174#issuecomment-265524339","issue_url":"https://api.github.com/repos/bluss/rust-itertools/issues/174","id":265524339,"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},"created_at":"2016-12-07T18:07:28Z","updated_at":"2016-12-07T18:07:28Z","body":"> It seems the reasonable thing is to emit one empty vector for n == 0, not no iterator elements?\r\n\r\nYes. This behaviour would also retain the fact that number of distinct combinations is equal to a binomial coefficient (n choose 0 = 1, for any n)."}}
{"actor":{"display_login":"nagisa"}}