{"action":"created","comment":{"url":"https://api.github.com/repos/softdevteam/cactus/pulls/comments/143412015","pull_request_review_id":67918780,"id":143412015,"diff_hunk":"@@ -327,4 +338,32 @@ mod tests {\n         assert_eq!(c.take_or_clone_val(), Some(3));\n         assert_eq!(c1.take_or_clone_val(), Some(2));\n     }\n+\n+    #[test]\n+    fn test_hash() {\n+        fn calculate_hash<T: Hash>(t: &T) -> u64 {\n+            let mut s = DefaultHasher::new();\n+            t.hash(&mut s);\n+            s.finish()\n+        }\n+\n+        let c1 = Cactus::new().child(4).child(3);\n+        let c2 = Cactus::new().child(4).child(3);\n+        assert_eq!(calculate_hash(&c1), calculate_hash(&c2));\n+        // The next test is fragile in theory although probably not in practise. Since there's no\n+        // guarantee that two distinct things will map to distinct hashes, it's perfectly possible\n+        // that a hasher returns the same value for two distinct cactuses. But this isn't hugely\n+        // likely to happen and, if it does, it'll be easy to work out what happened; it therefore\n+        // seems better to cope with the more likely \"someone temporarily replaced the hasher with","path":"src/lib.rs","position":null,"original_position":52,"commit_id":"28e51f327e4658ce423c1afa9d6091dc653eb804","original_commit_id":"b82b379a9914a6cdf9aae6f9a19e763811db8c83","user":{"login":"vext01","id":604955,"avatar_url":"https://avatars2.githubusercontent.com/u/604955?v=4","gravatar_id":"","url":"https://api.github.com/users/vext01","html_url":"https://github.com/vext01","followers_url":"https://api.github.com/users/vext01/followers","following_url":"https://api.github.com/users/vext01/following{/other_user}","gists_url":"https://api.github.com/users/vext01/gists{/gist_id}","starred_url":"https://api.github.com/users/vext01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vext01/subscriptions","organizations_url":"https://api.github.com/users/vext01/orgs","repos_url":"https://api.github.com/users/vext01/repos","events_url":"https://api.github.com/users/vext01/events{/privacy}","received_events_url":"https://api.github.com/users/vext01/received_events","type":"User","site_admin":false},"body":"I think that what you are saying here is that hashing collisions happen, but rarely.","created_at":"2017-10-09T08:55:18Z","updated_at":"2017-10-09T08:55:18Z","html_url":"https://github.com/softdevteam/cactus/pull/6#discussion_r143412015","pull_request_url":"https://api.github.com/repos/softdevteam/cactus/pulls/6","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/softdevteam/cactus/pulls/comments/143412015"},"html":{"href":"https://github.com/softdevteam/cactus/pull/6#discussion_r143412015"},"pull_request":{"href":"https://api.github.com/repos/softdevteam/cactus/pulls/6"}},"in_reply_to_id":143410693},"pull_request":{"url":"https://api.github.com/repos/softdevteam/cactus/pulls/6","id":145356989,"html_url":"https://github.com/softdevteam/cactus/pull/6","diff_url":"https://github.com/softdevteam/cactus/pull/6.diff","patch_url":"https://github.com/softdevteam/cactus/pull/6.patch","issue_url":"https://api.github.com/repos/softdevteam/cactus/issues/6","number":6,"state":"open","locked":false,"title":"Enable hashability for Cactuses.","user":{"login":"ltratt","id":20318,"avatar_url":"https://avatars1.githubusercontent.com/u/20318?v=4","gravatar_id":"","url":"https://api.github.com/users/ltratt","html_url":"https://github.com/ltratt","followers_url":"https://api.github.com/users/ltratt/followers","following_url":"https://api.github.com/users/ltratt/following{/other_user}","gists_url":"https://api.github.com/users/ltratt/gists{/gist_id}","starred_url":"https://api.github.com/users/ltratt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltratt/subscriptions","organizations_url":"https://api.github.com/users/ltratt/orgs","repos_url":"https://api.github.com/users/ltratt/repos","events_url":"https://api.github.com/users/ltratt/events{/privacy}","received_events_url":"https://api.github.com/users/ltratt/received_events","type":"User","site_admin":false},"body":"This allows cactii to be used as values in a `HashSet`, for example.","created_at":"2017-10-08T22:37:49Z","updated_at":"2017-10-09T08:55:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"772890500b7bbc99ebd4830f62b4cb3252279bd3","assignee":{"login":"vext01","id":604955,"avatar_url":"https://avatars2.githubusercontent.com/u/604955?v=4","gravatar_id":"","url":"https://api.github.com/users/vext01","html_url":"https://github.com/vext01","followers_url":"https://api.github.com/users/vext01/followers","following_url":"https://api.github.com/users/vext01/following{/other_user}","gists_url":"https://api.github.com/users/vext01/gists{/gist_id}","starred_url":"https://api.github.com/users/vext01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vext01/subscriptions","organizations_url":"https://api.github.com/users/vext01/orgs","repos_url":"https://api.github.com/users/vext01/repos","events_url":"https://api.github.com/users/vext01/events{/privacy}","received_events_url":"https://api.github.com/users/vext01/received_events","type":"User","site_admin":false},"assignees":[{"login":"vext01","id":604955,"avatar_url":"https://avatars2.githubusercontent.com/u/604955?v=4","gravatar_id":"","url":"https://api.github.com/users/vext01","html_url":"https://github.com/vext01","followers_url":"https://api.github.com/users/vext01/followers","following_url":"https://api.github.com/users/vext01/following{/other_user}","gists_url":"https://api.github.com/users/vext01/gists{/gist_id}","starred_url":"https://api.github.com/users/vext01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vext01/subscriptions","organizations_url":"https://api.github.com/users/vext01/orgs","repos_url":"https://api.github.com/users/vext01/repos","events_url":"https://api.github.com/users/vext01/events{/privacy}","received_events_url":"https://api.github.com/users/vext01/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/softdevteam/cactus/pulls/6/commits","review_comments_url":"https://api.github.com/repos/softdevteam/cactus/pulls/6/comments","review_comment_url":"https://api.github.com/repos/softdevteam/cactus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/softdevteam/cactus/issues/6/comments","statuses_url":"https://api.github.com/repos/softdevteam/cactus/statuses/28e51f327e4658ce423c1afa9d6091dc653eb804","head":{"label":"softdevteam:hashable","ref":"hashable","sha":"28e51f327e4658ce423c1afa9d6091dc653eb804","user":{"login":"softdevteam","id":10271085,"avatar_url":"https://avatars0.githubusercontent.com/u/10271085?v=4","gravatar_id":"","url":"https://api.github.com/users/softdevteam","html_url":"https://github.com/softdevteam","followers_url":"https://api.github.com/users/softdevteam/followers","following_url":"https://api.github.com/users/softdevteam/following{/other_user}","gists_url":"https://api.github.com/users/softdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/softdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softdevteam/subscriptions","organizations_url":"https://api.github.com/users/softdevteam/orgs","repos_url":"https://api.github.com/users/softdevteam/repos","events_url":"https://api.github.com/users/softdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/softdevteam/received_events","type":"Organization","site_admin":false},"repo":{"id":97608101,"name":"cactus","full_name":"softdevteam/cactus","owner":{"login":"softdevteam","id":10271085,"avatar_url":"https://avatars0.githubusercontent.com/u/10271085?v=4","gravatar_id":"","url":"https://api.github.com/users/softdevteam","html_url":"https://github.com/softdevteam","followers_url":"https://api.github.com/users/softdevteam/followers","following_url":"https://api.github.com/users/softdevteam/following{/other_user}","gists_url":"https://api.github.com/users/softdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/softdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softdevteam/subscriptions","organizations_url":"https://api.github.com/users/softdevteam/orgs","repos_url":"https://api.github.com/users/softdevteam/repos","events_url":"https://api.github.com/users/softdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/softdevteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/softdevteam/cactus","description":"Immutable cactus stack","fork":false,"url":"https://api.github.com/repos/softdevteam/cactus","forks_url":"https://api.github.com/repos/softdevteam/cactus/forks","keys_url":"https://api.github.com/repos/softdevteam/cactus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/softdevteam/cactus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/softdevteam/cactus/teams","hooks_url":"https://api.github.com/repos/softdevteam/cactus/hooks","issue_events_url":"https://api.github.com/repos/softdevteam/cactus/issues/events{/number}","events_url":"https://api.github.com/repos/softdevteam/cactus/events","assignees_url":"https://api.github.com/repos/softdevteam/cactus/assignees{/user}","branches_url":"https://api.github.com/repos/softdevteam/cactus/branches{/branch}","tags_url":"https://api.github.com/repos/softdevteam/cactus/tags","blobs_url":"https://api.github.com/repos/softdevteam/cactus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/softdevteam/cactus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/softdevteam/cactus/git/refs{/sha}","trees_url":"https://api.github.com/repos/softdevteam/cactus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/softdevteam/cactus/statuses/{sha}","languages_url":"https://api.github.com/repos/softdevteam/cactus/languages","stargazers_url":"https://api.github.com/repos/softdevteam/cactus/stargazers","contributors_url":"https://api.github.com/repos/softdevteam/cactus/contributors","subscribers_url":"https://api.github.com/repos/softdevteam/cactus/subscribers","subscription_url":"https://api.github.com/repos/softdevteam/cactus/subscription","commits_url":"https://api.github.com/repos/softdevteam/cactus/commits{/sha}","git_commits_url":"https://api.github.com/repos/softdevteam/cactus/git/commits{/sha}","comments_url":"https://api.github.com/repos/softdevteam/cactus/comments{/number}","issue_comment_url":"https://api.github.com/repos/softdevteam/cactus/issues/comments{/number}","contents_url":"https://api.github.com/repos/softdevteam/cactus/contents/{+path}","compare_url":"https://api.github.com/repos/softdevteam/cactus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/softdevteam/cactus/merges","archive_url":"https://api.github.com/repos/softdevteam/cactus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/softdevteam/cactus/downloads","issues_url":"https://api.github.com/repos/softdevteam/cactus/issues{/number}","pulls_url":"https://api.github.com/repos/softdevteam/cactus/pulls{/number}","milestones_url":"https://api.github.com/repos/softdevteam/cactus/milestones{/number}","notifications_url":"https://api.github.com/repos/softdevteam/cactus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/softdevteam/cactus/labels{/name}","releases_url":"https://api.github.com/repos/softdevteam/cactus/releases{/id}","deployments_url":"https://api.github.com/repos/softdevteam/cactus/deployments","created_at":"2017-07-18T14:28:15Z","updated_at":"2017-07-21T17:18:50Z","pushed_at":"2017-10-09T08:54:16Z","git_url":"git://github.com/softdevteam/cactus.git","ssh_url":"git@github.com:softdevteam/cactus.git","clone_url":"https://github.com/softdevteam/cactus.git","svn_url":"https://github.com/softdevteam/cactus","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"softdevteam:master","ref":"master","sha":"0bb71215cc1fb3c595428ea44fd9692460b87632","user":{"login":"softdevteam","id":10271085,"avatar_url":"https://avatars0.githubusercontent.com/u/10271085?v=4","gravatar_id":"","url":"https://api.github.com/users/softdevteam","html_url":"https://github.com/softdevteam","followers_url":"https://api.github.com/users/softdevteam/followers","following_url":"https://api.github.com/users/softdevteam/following{/other_user}","gists_url":"https://api.github.com/users/softdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/softdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softdevteam/subscriptions","organizations_url":"https://api.github.com/users/softdevteam/orgs","repos_url":"https://api.github.com/users/softdevteam/repos","events_url":"https://api.github.com/users/softdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/softdevteam/received_events","type":"Organization","site_admin":false},"repo":{"id":97608101,"name":"cactus","full_name":"softdevteam/cactus","owner":{"login":"softdevteam","id":10271085,"avatar_url":"https://avatars0.githubusercontent.com/u/10271085?v=4","gravatar_id":"","url":"https://api.github.com/users/softdevteam","html_url":"https://github.com/softdevteam","followers_url":"https://api.github.com/users/softdevteam/followers","following_url":"https://api.github.com/users/softdevteam/following{/other_user}","gists_url":"https://api.github.com/users/softdevteam/gists{/gist_id}","starred_url":"https://api.github.com/users/softdevteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softdevteam/subscriptions","organizations_url":"https://api.github.com/users/softdevteam/orgs","repos_url":"https://api.github.com/users/softdevteam/repos","events_url":"https://api.github.com/users/softdevteam/events{/privacy}","received_events_url":"https://api.github.com/users/softdevteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/softdevteam/cactus","description":"Immutable cactus stack","fork":false,"url":"https://api.github.com/repos/softdevteam/cactus","forks_url":"https://api.github.com/repos/softdevteam/cactus/forks","keys_url":"https://api.github.com/repos/softdevteam/cactus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/softdevteam/cactus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/softdevteam/cactus/teams","hooks_url":"https://api.github.com/repos/softdevteam/cactus/hooks","issue_events_url":"https://api.github.com/repos/softdevteam/cactus/issues/events{/number}","events_url":"https://api.github.com/repos/softdevteam/cactus/events","assignees_url":"https://api.github.com/repos/softdevteam/cactus/assignees{/user}","branches_url":"https://api.github.com/repos/softdevteam/cactus/branches{/branch}","tags_url":"https://api.github.com/repos/softdevteam/cactus/tags","blobs_url":"https://api.github.com/repos/softdevteam/cactus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/softdevteam/cactus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/softdevteam/cactus/git/refs{/sha}","trees_url":"https://api.github.com/repos/softdevteam/cactus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/softdevteam/cactus/statuses/{sha}","languages_url":"https://api.github.com/repos/softdevteam/cactus/languages","stargazers_url":"https://api.github.com/repos/softdevteam/cactus/stargazers","contributors_url":"https://api.github.com/repos/softdevteam/cactus/contributors","subscribers_url":"https://api.github.com/repos/softdevteam/cactus/subscribers","subscription_url":"https://api.github.com/repos/softdevteam/cactus/subscription","commits_url":"https://api.github.com/repos/softdevteam/cactus/commits{/sha}","git_commits_url":"https://api.github.com/repos/softdevteam/cactus/git/commits{/sha}","comments_url":"https://api.github.com/repos/softdevteam/cactus/comments{/number}","issue_comment_url":"https://api.github.com/repos/softdevteam/cactus/issues/comments{/number}","contents_url":"https://api.github.com/repos/softdevteam/cactus/contents/{+path}","compare_url":"https://api.github.com/repos/softdevteam/cactus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/softdevteam/cactus/merges","archive_url":"https://api.github.com/repos/softdevteam/cactus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/softdevteam/cactus/downloads","issues_url":"https://api.github.com/repos/softdevteam/cactus/issues{/number}","pulls_url":"https://api.github.com/repos/softdevteam/cactus/pulls{/number}","milestones_url":"https://api.github.com/repos/softdevteam/cactus/milestones{/number}","notifications_url":"https://api.github.com/repos/softdevteam/cactus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/softdevteam/cactus/labels{/name}","releases_url":"https://api.github.com/repos/softdevteam/cactus/releases{/id}","deployments_url":"https://api.github.com/repos/softdevteam/cactus/deployments","created_at":"2017-07-18T14:28:15Z","updated_at":"2017-07-21T17:18:50Z","pushed_at":"2017-10-09T08:54:16Z","git_url":"git://github.com/softdevteam/cactus.git","ssh_url":"git@github.com:softdevteam/cactus.git","clone_url":"https://github.com/softdevteam/cactus.git","svn_url":"https://github.com/softdevteam/cactus","homepage":null,"size":8,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/softdevteam/cactus/pulls/6"},"html":{"href":"https://github.com/softdevteam/cactus/pull/6"},"issue":{"href":"https://api.github.com/repos/softdevteam/cactus/issues/6"},"comments":{"href":"https://api.github.com/repos/softdevteam/cactus/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/softdevteam/cactus/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/softdevteam/cactus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/softdevteam/cactus/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/softdevteam/cactus/statuses/28e51f327e4658ce423c1afa9d6091dc653eb804"}},"author_association":"OWNER"}}
{"actor":{"display_login":"vext01"}}