{"action":"created","comment":{"url":"https://api.github.com/repos/Mattias-/ion/pulls/comments/22439636","id":22439636,"diff_hunk":"@@ -39,34 +46,26 @@ impl Parser {\n             (\"Neg\", vec![r\"-\", expr]),\n         ];\n \n-        let mut rules = vec![];\n-        for pp in parse_patterns.iter() {\n-            let (name, ref pattern_parts) = *pp;\n-            let mut regex_string = String::new();\n-            regex_string.push_str(\"^\");\n-            for part in pattern_parts.iter() {\n-                regex_string.push_str(*part);\n-            }\n-            regex_string.push_str(\"$\");\n-            let regex = Regex::new(regex_string.as_slice()).unwrap();\n-            rules.push(ParseRule {name: String::from_str(name), regex: regex});\n+        Parser {\n+            rules: parse_patterns\n+                .into_iter()\n+                .map(|(name, pattern_parts)|\n+                     (name, format!(\"^{}$\", { let s: String = pattern_parts.concat(); s })))\n+                .map(|(name, pattern)|\n+                     ParseRule {\n+                         name: name.to_owned(),\n+                         regex: Regex::new(pattern.as_slice()).unwrap()\n+                     }\n+                ).collect(),","path":"src/parser.rs","position":45,"original_position":45,"commit_id":"cd1cd06ba6a31efc6b3405ef20a93a871274e267","original_commit_id":"cd1cd06ba6a31efc6b3405ef20a93a871274e267","user":{"login":"Mattias-","id":1002805,"avatar_url":"https://avatars.githubusercontent.com/u/1002805?v=3","gravatar_id":"","url":"https://api.github.com/users/Mattias-","html_url":"https://github.com/Mattias-","followers_url":"https://api.github.com/users/Mattias-/followers","following_url":"https://api.github.com/users/Mattias-/following{/other_user}","gists_url":"https://api.github.com/users/Mattias-/gists{/gist_id}","starred_url":"https://api.github.com/users/Mattias-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mattias-/subscriptions","organizations_url":"https://api.github.com/users/Mattias-/orgs","repos_url":"https://api.github.com/users/Mattias-/repos","events_url":"https://api.github.com/users/Mattias-/events{/privacy}","received_events_url":"https://api.github.com/users/Mattias-/received_events","type":"User","site_admin":false},"body":"remove unnecessary comma","created_at":"2015-01-04T14:36:25Z","updated_at":"2015-01-04T14:36:25Z","html_url":"https://github.com/Mattias-/ion/pull/1#discussion_r22439636","pull_request_url":"https://api.github.com/repos/Mattias-/ion/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Mattias-/ion/pulls/comments/22439636"},"html":{"href":"https://github.com/Mattias-/ion/pull/1#discussion_r22439636"},"pull_request":{"href":"https://api.github.com/repos/Mattias-/ion/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Mattias-/ion/pulls/1","id":26789710,"html_url":"https://github.com/Mattias-/ion/pull/1","diff_url":"https://github.com/Mattias-/ion/pull/1.diff","patch_url":"https://github.com/Mattias-/ion/pull/1.patch","issue_url":"https://api.github.com/repos/Mattias-/ion/issues/1","number":1,"state":"open","locked":false,"title":"Various style fixes","user":{"login":"cmr","id":704250,"avatar_url":"https://avatars.githubusercontent.com/u/704250?v=3","gravatar_id":"","url":"https://api.github.com/users/cmr","html_url":"https://github.com/cmr","followers_url":"https://api.github.com/users/cmr/followers","following_url":"https://api.github.com/users/cmr/following{/other_user}","gists_url":"https://api.github.com/users/cmr/gists{/gist_id}","starred_url":"https://api.github.com/users/cmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmr/subscriptions","organizations_url":"https://api.github.com/users/cmr/orgs","repos_url":"https://api.github.com/users/cmr/repos","events_url":"https://api.github.com/users/cmr/events{/privacy}","received_events_url":"https://api.github.com/users/cmr/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-04T02:22:32Z","updated_at":"2015-01-04T14:36:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"478edd23703585d74b87936bedf0400a8890d132","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Mattias-/ion/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Mattias-/ion/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Mattias-/ion/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Mattias-/ion/issues/1/comments","statuses_url":"https://api.github.com/repos/Mattias-/ion/statuses/cd1cd06ba6a31efc6b3405ef20a93a871274e267","head":{"label":"cmr:master","ref":"master","sha":"cd1cd06ba6a31efc6b3405ef20a93a871274e267","user":{"login":"cmr","id":704250,"avatar_url":"https://avatars.githubusercontent.com/u/704250?v=3","gravatar_id":"","url":"https://api.github.com/users/cmr","html_url":"https://github.com/cmr","followers_url":"https://api.github.com/users/cmr/followers","following_url":"https://api.github.com/users/cmr/following{/other_user}","gists_url":"https://api.github.com/users/cmr/gists{/gist_id}","starred_url":"https://api.github.com/users/cmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmr/subscriptions","organizations_url":"https://api.github.com/users/cmr/orgs","repos_url":"https://api.github.com/users/cmr/repos","events_url":"https://api.github.com/users/cmr/events{/privacy}","received_events_url":"https://api.github.com/users/cmr/received_events","type":"User","site_admin":false},"repo":{"id":28757232,"name":"ion","full_name":"cmr/ion","owner":{"login":"cmr","id":704250,"avatar_url":"https://avatars.githubusercontent.com/u/704250?v=3","gravatar_id":"","url":"https://api.github.com/users/cmr","html_url":"https://github.com/cmr","followers_url":"https://api.github.com/users/cmr/followers","following_url":"https://api.github.com/users/cmr/following{/other_user}","gists_url":"https://api.github.com/users/cmr/gists{/gist_id}","starred_url":"https://api.github.com/users/cmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmr/subscriptions","organizations_url":"https://api.github.com/users/cmr/orgs","repos_url":"https://api.github.com/users/cmr/repos","events_url":"https://api.github.com/users/cmr/events{/privacy}","received_events_url":"https://api.github.com/users/cmr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmr/ion","description":"ion, the programming language","fork":true,"url":"https://api.github.com/repos/cmr/ion","forks_url":"https://api.github.com/repos/cmr/ion/forks","keys_url":"https://api.github.com/repos/cmr/ion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmr/ion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmr/ion/teams","hooks_url":"https://api.github.com/repos/cmr/ion/hooks","issue_events_url":"https://api.github.com/repos/cmr/ion/issues/events{/number}","events_url":"https://api.github.com/repos/cmr/ion/events","assignees_url":"https://api.github.com/repos/cmr/ion/assignees{/user}","branches_url":"https://api.github.com/repos/cmr/ion/branches{/branch}","tags_url":"https://api.github.com/repos/cmr/ion/tags","blobs_url":"https://api.github.com/repos/cmr/ion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmr/ion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmr/ion/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmr/ion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmr/ion/statuses/{sha}","languages_url":"https://api.github.com/repos/cmr/ion/languages","stargazers_url":"https://api.github.com/repos/cmr/ion/stargazers","contributors_url":"https://api.github.com/repos/cmr/ion/contributors","subscribers_url":"https://api.github.com/repos/cmr/ion/subscribers","subscription_url":"https://api.github.com/repos/cmr/ion/subscription","commits_url":"https://api.github.com/repos/cmr/ion/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmr/ion/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmr/ion/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmr/ion/issues/comments/{number}","contents_url":"https://api.github.com/repos/cmr/ion/contents/{+path}","compare_url":"https://api.github.com/repos/cmr/ion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmr/ion/merges","archive_url":"https://api.github.com/repos/cmr/ion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmr/ion/downloads","issues_url":"https://api.github.com/repos/cmr/ion/issues{/number}","pulls_url":"https://api.github.com/repos/cmr/ion/pulls{/number}","milestones_url":"https://api.github.com/repos/cmr/ion/milestones{/number}","notifications_url":"https://api.github.com/repos/cmr/ion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmr/ion/labels{/name}","releases_url":"https://api.github.com/repos/cmr/ion/releases{/id}","created_at":"2015-01-03T23:10:27Z","updated_at":"2015-01-04T10:13:54Z","pushed_at":"2015-01-04T10:13:54Z","git_url":"git://github.com/cmr/ion.git","ssh_url":"git@github.com:cmr/ion.git","clone_url":"https://github.com/cmr/ion.git","svn_url":"https://github.com/cmr/ion","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"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":"Mattias-:master","ref":"master","sha":"0814a3a2dd2e80b238adebd1bdc9dd3bbecaf837","user":{"login":"Mattias-","id":1002805,"avatar_url":"https://avatars.githubusercontent.com/u/1002805?v=3","gravatar_id":"","url":"https://api.github.com/users/Mattias-","html_url":"https://github.com/Mattias-","followers_url":"https://api.github.com/users/Mattias-/followers","following_url":"https://api.github.com/users/Mattias-/following{/other_user}","gists_url":"https://api.github.com/users/Mattias-/gists{/gist_id}","starred_url":"https://api.github.com/users/Mattias-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mattias-/subscriptions","organizations_url":"https://api.github.com/users/Mattias-/orgs","repos_url":"https://api.github.com/users/Mattias-/repos","events_url":"https://api.github.com/users/Mattias-/events{/privacy}","received_events_url":"https://api.github.com/users/Mattias-/received_events","type":"User","site_admin":false},"repo":{"id":28629593,"name":"ion","full_name":"Mattias-/ion","owner":{"login":"Mattias-","id":1002805,"avatar_url":"https://avatars.githubusercontent.com/u/1002805?v=3","gravatar_id":"","url":"https://api.github.com/users/Mattias-","html_url":"https://github.com/Mattias-","followers_url":"https://api.github.com/users/Mattias-/followers","following_url":"https://api.github.com/users/Mattias-/following{/other_user}","gists_url":"https://api.github.com/users/Mattias-/gists{/gist_id}","starred_url":"https://api.github.com/users/Mattias-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mattias-/subscriptions","organizations_url":"https://api.github.com/users/Mattias-/orgs","repos_url":"https://api.github.com/users/Mattias-/repos","events_url":"https://api.github.com/users/Mattias-/events{/privacy}","received_events_url":"https://api.github.com/users/Mattias-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mattias-/ion","description":"ion, the programming language","fork":false,"url":"https://api.github.com/repos/Mattias-/ion","forks_url":"https://api.github.com/repos/Mattias-/ion/forks","keys_url":"https://api.github.com/repos/Mattias-/ion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mattias-/ion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mattias-/ion/teams","hooks_url":"https://api.github.com/repos/Mattias-/ion/hooks","issue_events_url":"https://api.github.com/repos/Mattias-/ion/issues/events{/number}","events_url":"https://api.github.com/repos/Mattias-/ion/events","assignees_url":"https://api.github.com/repos/Mattias-/ion/assignees{/user}","branches_url":"https://api.github.com/repos/Mattias-/ion/branches{/branch}","tags_url":"https://api.github.com/repos/Mattias-/ion/tags","blobs_url":"https://api.github.com/repos/Mattias-/ion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mattias-/ion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mattias-/ion/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mattias-/ion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mattias-/ion/statuses/{sha}","languages_url":"https://api.github.com/repos/Mattias-/ion/languages","stargazers_url":"https://api.github.com/repos/Mattias-/ion/stargazers","contributors_url":"https://api.github.com/repos/Mattias-/ion/contributors","subscribers_url":"https://api.github.com/repos/Mattias-/ion/subscribers","subscription_url":"https://api.github.com/repos/Mattias-/ion/subscription","commits_url":"https://api.github.com/repos/Mattias-/ion/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mattias-/ion/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mattias-/ion/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mattias-/ion/issues/comments/{number}","contents_url":"https://api.github.com/repos/Mattias-/ion/contents/{+path}","compare_url":"https://api.github.com/repos/Mattias-/ion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mattias-/ion/merges","archive_url":"https://api.github.com/repos/Mattias-/ion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mattias-/ion/downloads","issues_url":"https://api.github.com/repos/Mattias-/ion/issues{/number}","pulls_url":"https://api.github.com/repos/Mattias-/ion/pulls{/number}","milestones_url":"https://api.github.com/repos/Mattias-/ion/milestones{/number}","notifications_url":"https://api.github.com/repos/Mattias-/ion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mattias-/ion/labels{/name}","releases_url":"https://api.github.com/repos/Mattias-/ion/releases{/id}","created_at":"2014-12-30T12:14:35Z","updated_at":"2015-01-04T12:32:25Z","pushed_at":"2015-01-02T23:31:01Z","git_url":"git://github.com/Mattias-/ion.git","ssh_url":"git@github.com:Mattias-/ion.git","clone_url":"https://github.com/Mattias-/ion.git","svn_url":"https://github.com/Mattias-/ion","homepage":null,"size":0,"stargazers_count":23,"watchers_count":23,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Mattias-/ion/pulls/1"},"html":{"href":"https://github.com/Mattias-/ion/pull/1"},"issue":{"href":"https://api.github.com/repos/Mattias-/ion/issues/1"},"comments":{"href":"https://api.github.com/repos/Mattias-/ion/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Mattias-/ion/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Mattias-/ion/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Mattias-/ion/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Mattias-/ion/statuses/cd1cd06ba6a31efc6b3405ef20a93a871274e267"}}}}