{"action":"created","comment":{"url":"https://api.github.com/repos/servo/rust-bindgen/pulls/comments/86692053","pull_request_review_id":7337593,"id":86692053,"diff_hunk":"@@ -71,16 +71,20 @@ impl Enum {\n         };\n \n         declaration.visit(|cursor| {\n-            if cursor.kind() == CXCursor_EnumConstantDecl {","path":"src/ir/enum_ty.rs","position":4,"original_position":4,"commit_id":"0bdc4dead9258397862669cfb41b8bb17b1d341b","original_commit_id":"725adba02dc36aab5f2312ba78ace2a310fc6f7d","user":{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"body":"I sort of agree, and in general it uses to be good advice. But in this case, IMO at least, this is inverting the dependency instead.\r\n\r\nThat is, if for some other reason `enum_val_signed` returns `Some` when it's not a `CXCursor_EnumConstantDecl`, the code meaning is completely different, and we're in trouble.\r\n\r\nWe're traversing the ast looking for `EnumConstantDecl` nodes, so I think that `if` should stay there instead of relying that this only returns `Some` if that's the case.","created_at":"2016-11-06T18:03:03Z","updated_at":"2016-11-06T18:03:03Z","html_url":"https://github.com/servo/rust-bindgen/pull/220#discussion_r86692053","pull_request_url":"https://api.github.com/repos/servo/rust-bindgen/pulls/220","_links":{"self":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/comments/86692053"},"html":{"href":"https://github.com/servo/rust-bindgen/pull/220#discussion_r86692053"},"pull_request":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/220"}}},"pull_request":{"url":"https://api.github.com/repos/servo/rust-bindgen/pulls/220","id":92494294,"html_url":"https://github.com/servo/rust-bindgen/pull/220","diff_url":"https://github.com/servo/rust-bindgen/pull/220.diff","patch_url":"https://github.com/servo/rust-bindgen/pull/220.patch","issue_url":"https://api.github.com/repos/servo/rust-bindgen/issues/220","number":220,"state":"open","locked":false,"title":"Wrap enum_val_signed in an Option.","user":{"login":"jcdyer","id":77486,"avatar_url":"https://avatars.githubusercontent.com/u/77486?v=3","gravatar_id":"","url":"https://api.github.com/users/jcdyer","html_url":"https://github.com/jcdyer","followers_url":"https://api.github.com/users/jcdyer/followers","following_url":"https://api.github.com/users/jcdyer/following{/other_user}","gists_url":"https://api.github.com/users/jcdyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jcdyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcdyer/subscriptions","organizations_url":"https://api.github.com/users/jcdyer/orgs","repos_url":"https://api.github.com/users/jcdyer/repos","events_url":"https://api.github.com/users/jcdyer/events{/privacy}","received_events_url":"https://api.github.com/users/jcdyer/received_events","type":"User","site_admin":false},"body":"Also reorganize calling code to avoid duplicate checking of cursor type.\r\n\r\nFixes #127","created_at":"2016-11-06T17:00:52Z","updated_at":"2016-11-06T18:03:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d88b51187d7043fdd56aca07d789c9e707acf966","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/servo/rust-bindgen/pulls/220/commits","review_comments_url":"https://api.github.com/repos/servo/rust-bindgen/pulls/220/comments","review_comment_url":"https://api.github.com/repos/servo/rust-bindgen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/rust-bindgen/issues/220/comments","statuses_url":"https://api.github.com/repos/servo/rust-bindgen/statuses/0bdc4dead9258397862669cfb41b8bb17b1d341b","head":{"label":"jcdyer:enum_value_signed","ref":"enum_value_signed","sha":"0bdc4dead9258397862669cfb41b8bb17b1d341b","user":{"login":"jcdyer","id":77486,"avatar_url":"https://avatars.githubusercontent.com/u/77486?v=3","gravatar_id":"","url":"https://api.github.com/users/jcdyer","html_url":"https://github.com/jcdyer","followers_url":"https://api.github.com/users/jcdyer/followers","following_url":"https://api.github.com/users/jcdyer/following{/other_user}","gists_url":"https://api.github.com/users/jcdyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jcdyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcdyer/subscriptions","organizations_url":"https://api.github.com/users/jcdyer/orgs","repos_url":"https://api.github.com/users/jcdyer/repos","events_url":"https://api.github.com/users/jcdyer/events{/privacy}","received_events_url":"https://api.github.com/users/jcdyer/received_events","type":"User","site_admin":false},"repo":{"id":72922021,"name":"rust-bindgen","full_name":"jcdyer/rust-bindgen","owner":{"login":"jcdyer","id":77486,"avatar_url":"https://avatars.githubusercontent.com/u/77486?v=3","gravatar_id":"","url":"https://api.github.com/users/jcdyer","html_url":"https://github.com/jcdyer","followers_url":"https://api.github.com/users/jcdyer/followers","following_url":"https://api.github.com/users/jcdyer/following{/other_user}","gists_url":"https://api.github.com/users/jcdyer/gists{/gist_id}","starred_url":"https://api.github.com/users/jcdyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcdyer/subscriptions","organizations_url":"https://api.github.com/users/jcdyer/orgs","repos_url":"https://api.github.com/users/jcdyer/repos","events_url":"https://api.github.com/users/jcdyer/events{/privacy}","received_events_url":"https://api.github.com/users/jcdyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcdyer/rust-bindgen","description":"binding generator for rust language","fork":true,"url":"https://api.github.com/repos/jcdyer/rust-bindgen","forks_url":"https://api.github.com/repos/jcdyer/rust-bindgen/forks","keys_url":"https://api.github.com/repos/jcdyer/rust-bindgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcdyer/rust-bindgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcdyer/rust-bindgen/teams","hooks_url":"https://api.github.com/repos/jcdyer/rust-bindgen/hooks","issue_events_url":"https://api.github.com/repos/jcdyer/rust-bindgen/issues/events{/number}","events_url":"https://api.github.com/repos/jcdyer/rust-bindgen/events","assignees_url":"https://api.github.com/repos/jcdyer/rust-bindgen/assignees{/user}","branches_url":"https://api.github.com/repos/jcdyer/rust-bindgen/branches{/branch}","tags_url":"https://api.github.com/repos/jcdyer/rust-bindgen/tags","blobs_url":"https://api.github.com/repos/jcdyer/rust-bindgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcdyer/rust-bindgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcdyer/rust-bindgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcdyer/rust-bindgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcdyer/rust-bindgen/statuses/{sha}","languages_url":"https://api.github.com/repos/jcdyer/rust-bindgen/languages","stargazers_url":"https://api.github.com/repos/jcdyer/rust-bindgen/stargazers","contributors_url":"https://api.github.com/repos/jcdyer/rust-bindgen/contributors","subscribers_url":"https://api.github.com/repos/jcdyer/rust-bindgen/subscribers","subscription_url":"https://api.github.com/repos/jcdyer/rust-bindgen/subscription","commits_url":"https://api.github.com/repos/jcdyer/rust-bindgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcdyer/rust-bindgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcdyer/rust-bindgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcdyer/rust-bindgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcdyer/rust-bindgen/contents/{+path}","compare_url":"https://api.github.com/repos/jcdyer/rust-bindgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcdyer/rust-bindgen/merges","archive_url":"https://api.github.com/repos/jcdyer/rust-bindgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcdyer/rust-bindgen/downloads","issues_url":"https://api.github.com/repos/jcdyer/rust-bindgen/issues{/number}","pulls_url":"https://api.github.com/repos/jcdyer/rust-bindgen/pulls{/number}","milestones_url":"https://api.github.com/repos/jcdyer/rust-bindgen/milestones{/number}","notifications_url":"https://api.github.com/repos/jcdyer/rust-bindgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcdyer/rust-bindgen/labels{/name}","releases_url":"https://api.github.com/repos/jcdyer/rust-bindgen/releases{/id}","deployments_url":"https://api.github.com/repos/jcdyer/rust-bindgen/deployments","created_at":"2016-11-05T11:30:58Z","updated_at":"2016-11-06T11:24:28Z","pushed_at":"2016-11-06T17:35:53Z","git_url":"git://github.com/jcdyer/rust-bindgen.git","ssh_url":"git@github.com:jcdyer/rust-bindgen.git","clone_url":"https://github.com/jcdyer/rust-bindgen.git","svn_url":"https://github.com/jcdyer/rust-bindgen","homepage":"","size":7611,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"servo:master","ref":"master","sha":"eaa674ef131f256fd01916f1f4ada6e8b76be749","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":61728459,"name":"rust-bindgen","full_name":"servo/rust-bindgen","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/rust-bindgen","description":"binding generator for rust language","fork":true,"url":"https://api.github.com/repos/servo/rust-bindgen","forks_url":"https://api.github.com/repos/servo/rust-bindgen/forks","keys_url":"https://api.github.com/repos/servo/rust-bindgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/rust-bindgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/rust-bindgen/teams","hooks_url":"https://api.github.com/repos/servo/rust-bindgen/hooks","issue_events_url":"https://api.github.com/repos/servo/rust-bindgen/issues/events{/number}","events_url":"https://api.github.com/repos/servo/rust-bindgen/events","assignees_url":"https://api.github.com/repos/servo/rust-bindgen/assignees{/user}","branches_url":"https://api.github.com/repos/servo/rust-bindgen/branches{/branch}","tags_url":"https://api.github.com/repos/servo/rust-bindgen/tags","blobs_url":"https://api.github.com/repos/servo/rust-bindgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/rust-bindgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/rust-bindgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/rust-bindgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/rust-bindgen/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/rust-bindgen/languages","stargazers_url":"https://api.github.com/repos/servo/rust-bindgen/stargazers","contributors_url":"https://api.github.com/repos/servo/rust-bindgen/contributors","subscribers_url":"https://api.github.com/repos/servo/rust-bindgen/subscribers","subscription_url":"https://api.github.com/repos/servo/rust-bindgen/subscription","commits_url":"https://api.github.com/repos/servo/rust-bindgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/rust-bindgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/rust-bindgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/rust-bindgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/rust-bindgen/contents/{+path}","compare_url":"https://api.github.com/repos/servo/rust-bindgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/rust-bindgen/merges","archive_url":"https://api.github.com/repos/servo/rust-bindgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/rust-bindgen/downloads","issues_url":"https://api.github.com/repos/servo/rust-bindgen/issues{/number}","pulls_url":"https://api.github.com/repos/servo/rust-bindgen/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/rust-bindgen/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/rust-bindgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/rust-bindgen/labels{/name}","releases_url":"https://api.github.com/repos/servo/rust-bindgen/releases{/id}","deployments_url":"https://api.github.com/repos/servo/rust-bindgen/deployments","created_at":"2016-06-22T15:05:51Z","updated_at":"2016-11-06T09:09:33Z","pushed_at":"2016-11-06T17:46:35Z","git_url":"git://github.com/servo/rust-bindgen.git","ssh_url":"git@github.com:servo/rust-bindgen.git","clone_url":"https://github.com/servo/rust-bindgen.git","svn_url":"https://github.com/servo/rust-bindgen","homepage":"","size":7678,"stargazers_count":42,"watchers_count":42,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":48,"forks":32,"open_issues":48,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/220"},"html":{"href":"https://github.com/servo/rust-bindgen/pull/220"},"issue":{"href":"https://api.github.com/repos/servo/rust-bindgen/issues/220"},"comments":{"href":"https://api.github.com/repos/servo/rust-bindgen/issues/220/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/220/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/rust-bindgen/pulls/220/commits"},"statuses":{"href":"https://api.github.com/repos/servo/rust-bindgen/statuses/0bdc4dead9258397862669cfb41b8bb17b1d341b"}}}}
{"actor":{"display_login":"emilio"}}