{"action":"created","comment":{"url":"https://api.github.com/repos/Nemo157/hamlet/pulls/comments/58107109","id":58107109,"diff_hunk":"@@ -0,0 +1,29 @@\n+use std::borrow::Cow;\n+\n+pub fn identifier_to_tag_name<'a, T>(s: T) -> Cow<'a, str>\n+    where T: Into<Cow<'a, str>>\n+{\n+    let mut owned: Option<String> = None;\n+    let s = s.into();\n+    {\n+        let bs: &str = s.as_ref();\n+        for (i, c) in bs.chars().enumerate() {\n+            match c {\n+                c @ 'A' ... 'Z' => {\n+                    let mut os = owned.unwrap_or({\n+                        let mut os = String::with_capacity(bs.len() + 4);\n+                        os.extend((&bs[..i]).chars());\n+                        os\n+                    });\n+                    os.push('-');\n+                    os.push(c.to_lowercase().next().unwrap());\n+                    owned = Some(os);\n+                }\n+                _ => if let Some(ref mut os) = owned {\n+                    os.push(c);","path":"src/util.rs","position":23,"original_position":23,"commit_id":"1fef3be3d7d5fee34354473b1311c618dae9fc68","original_commit_id":"1fef3be3d7d5fee34354473b1311c618dae9fc68","user":{"login":"critiqjo","id":1436441,"avatar_url":"https://avatars.githubusercontent.com/u/1436441?v=3","gravatar_id":"","url":"https://api.github.com/users/critiqjo","html_url":"https://github.com/critiqjo","followers_url":"https://api.github.com/users/critiqjo/followers","following_url":"https://api.github.com/users/critiqjo/following{/other_user}","gists_url":"https://api.github.com/users/critiqjo/gists{/gist_id}","starred_url":"https://api.github.com/users/critiqjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/critiqjo/subscriptions","organizations_url":"https://api.github.com/users/critiqjo/orgs","repos_url":"https://api.github.com/users/critiqjo/repos","events_url":"https://api.github.com/users/critiqjo/events{/privacy}","received_events_url":"https://api.github.com/users/critiqjo/received_events","type":"User","site_admin":false},"body":"This is inefficient as a means of copying... Should probably replace it with a (batched) `extend`... The hope is hyphenated tags are relatively rare...","created_at":"2016-03-31T18:48:22Z","updated_at":"2016-03-31T18:48:22Z","html_url":"https://github.com/Nemo157/hamlet/pull/2#discussion_r58107109","pull_request_url":"https://api.github.com/repos/Nemo157/hamlet/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Nemo157/hamlet/pulls/comments/58107109"},"html":{"href":"https://github.com/Nemo157/hamlet/pull/2#discussion_r58107109"},"pull_request":{"href":"https://api.github.com/repos/Nemo157/hamlet/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Nemo157/hamlet/pulls/2","id":64297852,"html_url":"https://github.com/Nemo157/hamlet/pull/2","diff_url":"https://github.com/Nemo157/hamlet/pull/2.diff","patch_url":"https://github.com/Nemo157/hamlet/pull/2.patch","issue_url":"https://api.github.com/repos/Nemo157/hamlet/issues/2","number":2,"state":"open","locked":false,"title":"Add events and basic macros","user":{"login":"Nemo157","id":81079,"avatar_url":"https://avatars.githubusercontent.com/u/81079?v=3","gravatar_id":"","url":"https://api.github.com/users/Nemo157","html_url":"https://github.com/Nemo157","followers_url":"https://api.github.com/users/Nemo157/followers","following_url":"https://api.github.com/users/Nemo157/following{/other_user}","gists_url":"https://api.github.com/users/Nemo157/gists{/gist_id}","starred_url":"https://api.github.com/users/Nemo157/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nemo157/subscriptions","organizations_url":"https://api.github.com/users/Nemo157/orgs","repos_url":"https://api.github.com/users/Nemo157/repos","events_url":"https://api.github.com/users/Nemo157/events{/privacy}","received_events_url":"https://api.github.com/users/Nemo157/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-28T07:41:14Z","updated_at":"2016-03-31T18:48:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89a8ecfce6b8fa82e3c0b424a6d3b13a23d5e968","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Nemo157/hamlet/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Nemo157/hamlet/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Nemo157/hamlet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nemo157/hamlet/issues/2/comments","statuses_url":"https://api.github.com/repos/Nemo157/hamlet/statuses/1fef3be3d7d5fee34354473b1311c618dae9fc68","head":{"label":"Nemo157:events","ref":"events","sha":"1fef3be3d7d5fee34354473b1311c618dae9fc68","user":{"login":"Nemo157","id":81079,"avatar_url":"https://avatars.githubusercontent.com/u/81079?v=3","gravatar_id":"","url":"https://api.github.com/users/Nemo157","html_url":"https://github.com/Nemo157","followers_url":"https://api.github.com/users/Nemo157/followers","following_url":"https://api.github.com/users/Nemo157/following{/other_user}","gists_url":"https://api.github.com/users/Nemo157/gists{/gist_id}","starred_url":"https://api.github.com/users/Nemo157/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nemo157/subscriptions","organizations_url":"https://api.github.com/users/Nemo157/orgs","repos_url":"https://api.github.com/users/Nemo157/repos","events_url":"https://api.github.com/users/Nemo157/events{/privacy}","received_events_url":"https://api.github.com/users/Nemo157/received_events","type":"User","site_admin":false},"repo":{"id":54832853,"name":"hamlet","full_name":"Nemo157/hamlet","owner":{"login":"Nemo157","id":81079,"avatar_url":"https://avatars.githubusercontent.com/u/81079?v=3","gravatar_id":"","url":"https://api.github.com/users/Nemo157","html_url":"https://github.com/Nemo157","followers_url":"https://api.github.com/users/Nemo157/followers","following_url":"https://api.github.com/users/Nemo157/following{/other_user}","gists_url":"https://api.github.com/users/Nemo157/gists{/gist_id}","starred_url":"https://api.github.com/users/Nemo157/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nemo157/subscriptions","organizations_url":"https://api.github.com/users/Nemo157/orgs","repos_url":"https://api.github.com/users/Nemo157/repos","events_url":"https://api.github.com/users/Nemo157/events{/privacy}","received_events_url":"https://api.github.com/users/Nemo157/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nemo157/hamlet","description":"","fork":false,"url":"https://api.github.com/repos/Nemo157/hamlet","forks_url":"https://api.github.com/repos/Nemo157/hamlet/forks","keys_url":"https://api.github.com/repos/Nemo157/hamlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nemo157/hamlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nemo157/hamlet/teams","hooks_url":"https://api.github.com/repos/Nemo157/hamlet/hooks","issue_events_url":"https://api.github.com/repos/Nemo157/hamlet/issues/events{/number}","events_url":"https://api.github.com/repos/Nemo157/hamlet/events","assignees_url":"https://api.github.com/repos/Nemo157/hamlet/assignees{/user}","branches_url":"https://api.github.com/repos/Nemo157/hamlet/branches{/branch}","tags_url":"https://api.github.com/repos/Nemo157/hamlet/tags","blobs_url":"https://api.github.com/repos/Nemo157/hamlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nemo157/hamlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nemo157/hamlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nemo157/hamlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nemo157/hamlet/statuses/{sha}","languages_url":"https://api.github.com/repos/Nemo157/hamlet/languages","stargazers_url":"https://api.github.com/repos/Nemo157/hamlet/stargazers","contributors_url":"https://api.github.com/repos/Nemo157/hamlet/contributors","subscribers_url":"https://api.github.com/repos/Nemo157/hamlet/subscribers","subscription_url":"https://api.github.com/repos/Nemo157/hamlet/subscription","commits_url":"https://api.github.com/repos/Nemo157/hamlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nemo157/hamlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nemo157/hamlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nemo157/hamlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nemo157/hamlet/contents/{+path}","compare_url":"https://api.github.com/repos/Nemo157/hamlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nemo157/hamlet/merges","archive_url":"https://api.github.com/repos/Nemo157/hamlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nemo157/hamlet/downloads","issues_url":"https://api.github.com/repos/Nemo157/hamlet/issues{/number}","pulls_url":"https://api.github.com/repos/Nemo157/hamlet/pulls{/number}","milestones_url":"https://api.github.com/repos/Nemo157/hamlet/milestones{/number}","notifications_url":"https://api.github.com/repos/Nemo157/hamlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nemo157/hamlet/labels{/name}","releases_url":"https://api.github.com/repos/Nemo157/hamlet/releases{/id}","deployments_url":"https://api.github.com/repos/Nemo157/hamlet/deployments","created_at":"2016-03-27T14:42:35Z","updated_at":"2016-03-29T16:55:36Z","pushed_at":"2016-03-31T18:31:59Z","git_url":"git://github.com/Nemo157/hamlet.git","ssh_url":"git@github.com:Nemo157/hamlet.git","clone_url":"https://github.com/Nemo157/hamlet.git","svn_url":"https://github.com/Nemo157/hamlet","homepage":null,"size":27,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"Nemo157:master","ref":"master","sha":"fe2c5f681762a67b23ac708e515a3a730040669d","user":{"login":"Nemo157","id":81079,"avatar_url":"https://avatars.githubusercontent.com/u/81079?v=3","gravatar_id":"","url":"https://api.github.com/users/Nemo157","html_url":"https://github.com/Nemo157","followers_url":"https://api.github.com/users/Nemo157/followers","following_url":"https://api.github.com/users/Nemo157/following{/other_user}","gists_url":"https://api.github.com/users/Nemo157/gists{/gist_id}","starred_url":"https://api.github.com/users/Nemo157/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nemo157/subscriptions","organizations_url":"https://api.github.com/users/Nemo157/orgs","repos_url":"https://api.github.com/users/Nemo157/repos","events_url":"https://api.github.com/users/Nemo157/events{/privacy}","received_events_url":"https://api.github.com/users/Nemo157/received_events","type":"User","site_admin":false},"repo":{"id":54832853,"name":"hamlet","full_name":"Nemo157/hamlet","owner":{"login":"Nemo157","id":81079,"avatar_url":"https://avatars.githubusercontent.com/u/81079?v=3","gravatar_id":"","url":"https://api.github.com/users/Nemo157","html_url":"https://github.com/Nemo157","followers_url":"https://api.github.com/users/Nemo157/followers","following_url":"https://api.github.com/users/Nemo157/following{/other_user}","gists_url":"https://api.github.com/users/Nemo157/gists{/gist_id}","starred_url":"https://api.github.com/users/Nemo157/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nemo157/subscriptions","organizations_url":"https://api.github.com/users/Nemo157/orgs","repos_url":"https://api.github.com/users/Nemo157/repos","events_url":"https://api.github.com/users/Nemo157/events{/privacy}","received_events_url":"https://api.github.com/users/Nemo157/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nemo157/hamlet","description":"","fork":false,"url":"https://api.github.com/repos/Nemo157/hamlet","forks_url":"https://api.github.com/repos/Nemo157/hamlet/forks","keys_url":"https://api.github.com/repos/Nemo157/hamlet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nemo157/hamlet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nemo157/hamlet/teams","hooks_url":"https://api.github.com/repos/Nemo157/hamlet/hooks","issue_events_url":"https://api.github.com/repos/Nemo157/hamlet/issues/events{/number}","events_url":"https://api.github.com/repos/Nemo157/hamlet/events","assignees_url":"https://api.github.com/repos/Nemo157/hamlet/assignees{/user}","branches_url":"https://api.github.com/repos/Nemo157/hamlet/branches{/branch}","tags_url":"https://api.github.com/repos/Nemo157/hamlet/tags","blobs_url":"https://api.github.com/repos/Nemo157/hamlet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nemo157/hamlet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nemo157/hamlet/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nemo157/hamlet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nemo157/hamlet/statuses/{sha}","languages_url":"https://api.github.com/repos/Nemo157/hamlet/languages","stargazers_url":"https://api.github.com/repos/Nemo157/hamlet/stargazers","contributors_url":"https://api.github.com/repos/Nemo157/hamlet/contributors","subscribers_url":"https://api.github.com/repos/Nemo157/hamlet/subscribers","subscription_url":"https://api.github.com/repos/Nemo157/hamlet/subscription","commits_url":"https://api.github.com/repos/Nemo157/hamlet/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nemo157/hamlet/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nemo157/hamlet/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nemo157/hamlet/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nemo157/hamlet/contents/{+path}","compare_url":"https://api.github.com/repos/Nemo157/hamlet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nemo157/hamlet/merges","archive_url":"https://api.github.com/repos/Nemo157/hamlet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nemo157/hamlet/downloads","issues_url":"https://api.github.com/repos/Nemo157/hamlet/issues{/number}","pulls_url":"https://api.github.com/repos/Nemo157/hamlet/pulls{/number}","milestones_url":"https://api.github.com/repos/Nemo157/hamlet/milestones{/number}","notifications_url":"https://api.github.com/repos/Nemo157/hamlet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nemo157/hamlet/labels{/name}","releases_url":"https://api.github.com/repos/Nemo157/hamlet/releases{/id}","deployments_url":"https://api.github.com/repos/Nemo157/hamlet/deployments","created_at":"2016-03-27T14:42:35Z","updated_at":"2016-03-29T16:55:36Z","pushed_at":"2016-03-31T18:31:59Z","git_url":"git://github.com/Nemo157/hamlet.git","ssh_url":"git@github.com:Nemo157/hamlet.git","clone_url":"https://github.com/Nemo157/hamlet.git","svn_url":"https://github.com/Nemo157/hamlet","homepage":null,"size":27,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Nemo157/hamlet/pulls/2"},"html":{"href":"https://github.com/Nemo157/hamlet/pull/2"},"issue":{"href":"https://api.github.com/repos/Nemo157/hamlet/issues/2"},"comments":{"href":"https://api.github.com/repos/Nemo157/hamlet/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Nemo157/hamlet/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Nemo157/hamlet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nemo157/hamlet/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Nemo157/hamlet/statuses/1fef3be3d7d5fee34354473b1311c618dae9fc68"}}}}