{"action":"created","comment":{"url":"https://api.github.com/repos/Marwes/combine/pulls/comments/131615118","pull_request_review_id":54610972,"id":131615118,"diff_hunk":"@@ -624,6 +624,107 @@ parser!{\n     }\n }\n \n+#[derive(Clone)]\n+pub struct CountMinMax<F, P> {\n+    parser: P,\n+    min: usize,\n+    max: usize,\n+    _marker: PhantomData<fn() -> F>,\n+}\n+\n+impl<P, F> Parser for CountMinMax<F, P>\n+where\n+    P: Parser,\n+    F: FromIterator<P::Output>,\n+{\n+    type Input = P::Input;\n+    type Output = F;\n+\n+    #[inline]\n+    fn parse_lazy(&mut self, input: P::Input) -> ConsumedResult<F, P::Input> {\n+        let mut iter = self.parser.by_ref().iter(input.clone());\n+        let mut len = 0usize;\n+        let value = iter.by_ref().take(self.max).inspect(|_| { len += 1 }).collect();\n+        if len < self.min {\n+            let message = Error::Message(format!(\"expected {} more elements\", self.min - len).into());\n+            ConsumedErr(ParseError::new(input.position(), message))\n+        } else {\n+            iter.into_result_fast(value)\n+        }\n+    }\n+\n+    fn add_error(&mut self, error: &mut ParseError<Self::Input>) {\n+        self.parser.add_error(error)\n+    }\n+}\n+\n+/// Parses `parser` from `min` to `max` times (including `min` and `max`).\n+///\n+/// ```\n+/// # extern crate combine;\n+/// # use combine::*;\n+/// # use combine::primitives::{BytePosition, Error, Info};\n+/// # fn main() {\n+/// let mut parser = count_min_max(2, 2, token(b'a'));\n+///\n+/// let result = parser.parse(&b\"aaab\"[..]);\n+/// assert_eq!(result, Ok((b\"aa\"[..].to_owned(), &b\"ab\"[..])));\n+/// let result = parser.parse(&b\"ab\"[..]);\n+/// assert!(result.is_err());\n+/// # }\n+/// ```\n+///\n+/// # Panics\n+///\n+/// If `min` > `max`.\n+#[inline(always)]\n+pub fn count_min_max<F, P>(min: usize, max: usize, parser: P) -> CountMinMax<F, P>\n+where\n+    P: Parser,\n+    F: FromIterator<P::Output>,\n+{\n+    assert!(min <= max);\n+\n+    CountMinMax {\n+        parser: parser,\n+        min: min,\n+        max: max,\n+        _marker: PhantomData,\n+    }\n+}\n+\n+pub type SkipCountMinMax<P> = skip_count_min_max::SkipCountMinMax<P>;\n+parser!{","path":"src/combinator.rs","position":74,"original_position":74,"commit_id":"de2f7e887b110d98213bc93a83bac11abdcda522","original_commit_id":"de2f7e887b110d98213bc93a83bac11abdcda522","user":{"login":"Marwes","id":957312,"avatar_url":"https://avatars3.githubusercontent.com/u/957312?v=4","gravatar_id":"","url":"https://api.github.com/users/Marwes","html_url":"https://github.com/Marwes","followers_url":"https://api.github.com/users/Marwes/followers","following_url":"https://api.github.com/users/Marwes/following{/other_user}","gists_url":"https://api.github.com/users/Marwes/gists{/gist_id}","starred_url":"https://api.github.com/users/Marwes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marwes/subscriptions","organizations_url":"https://api.github.com/users/Marwes/orgs","repos_url":"https://api.github.com/users/Marwes/repos","events_url":"https://api.github.com/users/Marwes/events{/privacy}","received_events_url":"https://api.github.com/users/Marwes/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2017-08-07T09:51:30Z","updated_at":"2017-08-07T09:51:30Z","html_url":"https://github.com/Marwes/combine/pull/111#discussion_r131615118","pull_request_url":"https://api.github.com/repos/Marwes/combine/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/Marwes/combine/pulls/comments/131615118"},"html":{"href":"https://github.com/Marwes/combine/pull/111#discussion_r131615118"},"pull_request":{"href":"https://api.github.com/repos/Marwes/combine/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/Marwes/combine/pulls/111","id":134398238,"html_url":"https://github.com/Marwes/combine/pull/111","diff_url":"https://github.com/Marwes/combine/pull/111.diff","patch_url":"https://github.com/Marwes/combine/pull/111.patch","issue_url":"https://api.github.com/repos/Marwes/combine/issues/111","number":111,"state":"open","locked":false,"title":"feat: count_min_max and skip_count_min_max","user":{"login":"ordian","id":4211399,"avatar_url":"https://avatars1.githubusercontent.com/u/4211399?v=4","gravatar_id":"","url":"https://api.github.com/users/ordian","html_url":"https://github.com/ordian","followers_url":"https://api.github.com/users/ordian/followers","following_url":"https://api.github.com/users/ordian/following{/other_user}","gists_url":"https://api.github.com/users/ordian/gists{/gist_id}","starred_url":"https://api.github.com/users/ordian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordian/subscriptions","organizations_url":"https://api.github.com/users/ordian/orgs","repos_url":"https://api.github.com/users/ordian/repos","events_url":"https://api.github.com/users/ordian/events{/privacy}","received_events_url":"https://api.github.com/users/ordian/received_events","type":"User","site_admin":false},"body":"This PR doesn't deprecate count and skip_count.","created_at":"2017-08-07T09:38:47Z","updated_at":"2017-08-07T09:51:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cc151a8cf1f45504c5337b79bde3afea085755e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Marwes/combine/pulls/111/commits","review_comments_url":"https://api.github.com/repos/Marwes/combine/pulls/111/comments","review_comment_url":"https://api.github.com/repos/Marwes/combine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Marwes/combine/issues/111/comments","statuses_url":"https://api.github.com/repos/Marwes/combine/statuses/de2f7e887b110d98213bc93a83bac11abdcda522","head":{"label":"ordian:count_min_max","ref":"count_min_max","sha":"de2f7e887b110d98213bc93a83bac11abdcda522","user":{"login":"ordian","id":4211399,"avatar_url":"https://avatars1.githubusercontent.com/u/4211399?v=4","gravatar_id":"","url":"https://api.github.com/users/ordian","html_url":"https://github.com/ordian","followers_url":"https://api.github.com/users/ordian/followers","following_url":"https://api.github.com/users/ordian/following{/other_user}","gists_url":"https://api.github.com/users/ordian/gists{/gist_id}","starred_url":"https://api.github.com/users/ordian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordian/subscriptions","organizations_url":"https://api.github.com/users/ordian/orgs","repos_url":"https://api.github.com/users/ordian/repos","events_url":"https://api.github.com/users/ordian/events{/privacy}","received_events_url":"https://api.github.com/users/ordian/received_events","type":"User","site_admin":false},"repo":{"id":99554486,"name":"combine","full_name":"ordian/combine","owner":{"login":"ordian","id":4211399,"avatar_url":"https://avatars1.githubusercontent.com/u/4211399?v=4","gravatar_id":"","url":"https://api.github.com/users/ordian","html_url":"https://github.com/ordian","followers_url":"https://api.github.com/users/ordian/followers","following_url":"https://api.github.com/users/ordian/following{/other_user}","gists_url":"https://api.github.com/users/ordian/gists{/gist_id}","starred_url":"https://api.github.com/users/ordian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordian/subscriptions","organizations_url":"https://api.github.com/users/ordian/orgs","repos_url":"https://api.github.com/users/ordian/repos","events_url":"https://api.github.com/users/ordian/events{/privacy}","received_events_url":"https://api.github.com/users/ordian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ordian/combine","description":"A parser combinator library for Rust","fork":true,"url":"https://api.github.com/repos/ordian/combine","forks_url":"https://api.github.com/repos/ordian/combine/forks","keys_url":"https://api.github.com/repos/ordian/combine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ordian/combine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ordian/combine/teams","hooks_url":"https://api.github.com/repos/ordian/combine/hooks","issue_events_url":"https://api.github.com/repos/ordian/combine/issues/events{/number}","events_url":"https://api.github.com/repos/ordian/combine/events","assignees_url":"https://api.github.com/repos/ordian/combine/assignees{/user}","branches_url":"https://api.github.com/repos/ordian/combine/branches{/branch}","tags_url":"https://api.github.com/repos/ordian/combine/tags","blobs_url":"https://api.github.com/repos/ordian/combine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ordian/combine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ordian/combine/git/refs{/sha}","trees_url":"https://api.github.com/repos/ordian/combine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ordian/combine/statuses/{sha}","languages_url":"https://api.github.com/repos/ordian/combine/languages","stargazers_url":"https://api.github.com/repos/ordian/combine/stargazers","contributors_url":"https://api.github.com/repos/ordian/combine/contributors","subscribers_url":"https://api.github.com/repos/ordian/combine/subscribers","subscription_url":"https://api.github.com/repos/ordian/combine/subscription","commits_url":"https://api.github.com/repos/ordian/combine/commits{/sha}","git_commits_url":"https://api.github.com/repos/ordian/combine/git/commits{/sha}","comments_url":"https://api.github.com/repos/ordian/combine/comments{/number}","issue_comment_url":"https://api.github.com/repos/ordian/combine/issues/comments{/number}","contents_url":"https://api.github.com/repos/ordian/combine/contents/{+path}","compare_url":"https://api.github.com/repos/ordian/combine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ordian/combine/merges","archive_url":"https://api.github.com/repos/ordian/combine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ordian/combine/downloads","issues_url":"https://api.github.com/repos/ordian/combine/issues{/number}","pulls_url":"https://api.github.com/repos/ordian/combine/pulls{/number}","milestones_url":"https://api.github.com/repos/ordian/combine/milestones{/number}","notifications_url":"https://api.github.com/repos/ordian/combine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ordian/combine/labels{/name}","releases_url":"https://api.github.com/repos/ordian/combine/releases{/id}","deployments_url":"https://api.github.com/repos/ordian/combine/deployments","created_at":"2017-08-07T08:21:50Z","updated_at":"2017-08-07T08:21:51Z","pushed_at":"2017-08-07T09:37:54Z","git_url":"git://github.com/ordian/combine.git","ssh_url":"git@github.com:ordian/combine.git","clone_url":"https://github.com/ordian/combine.git","svn_url":"https://github.com/ordian/combine","homepage":"","size":2129,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Marwes:master","ref":"master","sha":"5377cfc3d5b102b7ae2dc709052d99b4bb37546d","user":{"login":"Marwes","id":957312,"avatar_url":"https://avatars3.githubusercontent.com/u/957312?v=4","gravatar_id":"","url":"https://api.github.com/users/Marwes","html_url":"https://github.com/Marwes","followers_url":"https://api.github.com/users/Marwes/followers","following_url":"https://api.github.com/users/Marwes/following{/other_user}","gists_url":"https://api.github.com/users/Marwes/gists{/gist_id}","starred_url":"https://api.github.com/users/Marwes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marwes/subscriptions","organizations_url":"https://api.github.com/users/Marwes/orgs","repos_url":"https://api.github.com/users/Marwes/repos","events_url":"https://api.github.com/users/Marwes/events{/privacy}","received_events_url":"https://api.github.com/users/Marwes/received_events","type":"User","site_admin":false},"repo":{"id":29131678,"name":"combine","full_name":"Marwes/combine","owner":{"login":"Marwes","id":957312,"avatar_url":"https://avatars3.githubusercontent.com/u/957312?v=4","gravatar_id":"","url":"https://api.github.com/users/Marwes","html_url":"https://github.com/Marwes","followers_url":"https://api.github.com/users/Marwes/followers","following_url":"https://api.github.com/users/Marwes/following{/other_user}","gists_url":"https://api.github.com/users/Marwes/gists{/gist_id}","starred_url":"https://api.github.com/users/Marwes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Marwes/subscriptions","organizations_url":"https://api.github.com/users/Marwes/orgs","repos_url":"https://api.github.com/users/Marwes/repos","events_url":"https://api.github.com/users/Marwes/events{/privacy}","received_events_url":"https://api.github.com/users/Marwes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Marwes/combine","description":"A parser combinator library for Rust","fork":false,"url":"https://api.github.com/repos/Marwes/combine","forks_url":"https://api.github.com/repos/Marwes/combine/forks","keys_url":"https://api.github.com/repos/Marwes/combine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Marwes/combine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Marwes/combine/teams","hooks_url":"https://api.github.com/repos/Marwes/combine/hooks","issue_events_url":"https://api.github.com/repos/Marwes/combine/issues/events{/number}","events_url":"https://api.github.com/repos/Marwes/combine/events","assignees_url":"https://api.github.com/repos/Marwes/combine/assignees{/user}","branches_url":"https://api.github.com/repos/Marwes/combine/branches{/branch}","tags_url":"https://api.github.com/repos/Marwes/combine/tags","blobs_url":"https://api.github.com/repos/Marwes/combine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Marwes/combine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Marwes/combine/git/refs{/sha}","trees_url":"https://api.github.com/repos/Marwes/combine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Marwes/combine/statuses/{sha}","languages_url":"https://api.github.com/repos/Marwes/combine/languages","stargazers_url":"https://api.github.com/repos/Marwes/combine/stargazers","contributors_url":"https://api.github.com/repos/Marwes/combine/contributors","subscribers_url":"https://api.github.com/repos/Marwes/combine/subscribers","subscription_url":"https://api.github.com/repos/Marwes/combine/subscription","commits_url":"https://api.github.com/repos/Marwes/combine/commits{/sha}","git_commits_url":"https://api.github.com/repos/Marwes/combine/git/commits{/sha}","comments_url":"https://api.github.com/repos/Marwes/combine/comments{/number}","issue_comment_url":"https://api.github.com/repos/Marwes/combine/issues/comments{/number}","contents_url":"https://api.github.com/repos/Marwes/combine/contents/{+path}","compare_url":"https://api.github.com/repos/Marwes/combine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Marwes/combine/merges","archive_url":"https://api.github.com/repos/Marwes/combine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Marwes/combine/downloads","issues_url":"https://api.github.com/repos/Marwes/combine/issues{/number}","pulls_url":"https://api.github.com/repos/Marwes/combine/pulls{/number}","milestones_url":"https://api.github.com/repos/Marwes/combine/milestones{/number}","notifications_url":"https://api.github.com/repos/Marwes/combine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Marwes/combine/labels{/name}","releases_url":"https://api.github.com/repos/Marwes/combine/releases{/id}","deployments_url":"https://api.github.com/repos/Marwes/combine/deployments","created_at":"2015-01-12T11:04:51Z","updated_at":"2017-08-05T15:19:54Z","pushed_at":"2017-08-07T09:48:32Z","git_url":"git://github.com/Marwes/combine.git","ssh_url":"git@github.com:Marwes/combine.git","clone_url":"https://github.com/Marwes/combine.git","svn_url":"https://github.com/Marwes/combine","homepage":"","size":2129,"stargazers_count":316,"watchers_count":316,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":26,"mirror_url":null,"open_issues_count":18,"forks":26,"open_issues":18,"watchers":316,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Marwes/combine/pulls/111"},"html":{"href":"https://github.com/Marwes/combine/pull/111"},"issue":{"href":"https://api.github.com/repos/Marwes/combine/issues/111"},"comments":{"href":"https://api.github.com/repos/Marwes/combine/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/Marwes/combine/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/Marwes/combine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Marwes/combine/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/Marwes/combine/statuses/de2f7e887b110d98213bc93a83bac11abdcda522"}}}}
{"actor":{"display_login":"Marwes"}}