{"action":"created","comment":{"url":"https://api.github.com/repos/gtk-rs/glib/pulls/comments/133841674","pull_request_review_id":57069498,"id":133841674,"diff_hunk":"@@ -628,6 +629,20 @@ impl<T: IsA<Object> + SetValue> ObjectExt for T {\n         }\n     }\n \n+    fn has_property_with_type<'a, N: Into<&'a str>>(&self, property_name: N, type_: Type) -> Result<(), BoolError> {\n+        let property_name = property_name.into();\n+        let ptype = self.get_property_type(property_name);\n+\n+        match ptype {\n+            None => Err(BoolError(\"Invalid property name\")),\n+            Some(ptype) => if ptype == type_ {","path":"src/object.rs","position":29,"original_position":29,"commit_id":"4837898a28cb36cacde25f8beca7b328ef627a4a","original_commit_id":"4837898a28cb36cacde25f8beca7b328ef627a4a","user":{"login":"fengalin","id":28687262,"avatar_url":"https://avatars0.githubusercontent.com/u/28687262?v=4","gravatar_id":"","url":"https://api.github.com/users/fengalin","html_url":"https://github.com/fengalin","followers_url":"https://api.github.com/users/fengalin/followers","following_url":"https://api.github.com/users/fengalin/following{/other_user}","gists_url":"https://api.github.com/users/fengalin/gists{/gist_id}","starred_url":"https://api.github.com/users/fengalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fengalin/subscriptions","organizations_url":"https://api.github.com/users/fengalin/orgs","repos_url":"https://api.github.com/users/fengalin/repos","events_url":"https://api.github.com/users/fengalin/events{/privacy}","received_events_url":"https://api.github.com/users/fengalin/received_events","type":"User","site_admin":false},"body":"Yeah, I agree! I'm just not too sure about what the custom is. Would that be better:\r\n``` rust\r\n        if let Some(ptype) = ptype {\r\n            if ptype == type_ {\r\n                Ok(())\r\n            } else {\r\n                Err(BoolError(\"Invalid property type\"))\r\n            }\r\n        } else {\r\n            Err(BoolError(\"Invalid property name\"))\r\n        }\r\n```","created_at":"2017-08-17T22:08:59Z","updated_at":"2017-08-17T22:08:59Z","html_url":"https://github.com/gtk-rs/glib/pull/214#discussion_r133841674","pull_request_url":"https://api.github.com/repos/gtk-rs/glib/pulls/214","_links":{"self":{"href":"https://api.github.com/repos/gtk-rs/glib/pulls/comments/133841674"},"html":{"href":"https://github.com/gtk-rs/glib/pull/214#discussion_r133841674"},"pull_request":{"href":"https://api.github.com/repos/gtk-rs/glib/pulls/214"}}},"pull_request":{"url":"https://api.github.com/repos/gtk-rs/glib/pulls/214","id":136357177,"html_url":"https://github.com/gtk-rs/glib/pull/214","diff_url":"https://github.com/gtk-rs/glib/pull/214.diff","patch_url":"https://github.com/gtk-rs/glib/pull/214.patch","issue_url":"https://api.github.com/repos/gtk-rs/glib/issues/214","number":214,"state":"open","locked":false,"title":"Be more precise when setting a property with invalid type","user":{"login":"fengalin","id":28687262,"avatar_url":"https://avatars0.githubusercontent.com/u/28687262?v=4","gravatar_id":"","url":"https://api.github.com/users/fengalin","html_url":"https://github.com/fengalin","followers_url":"https://api.github.com/users/fengalin/followers","following_url":"https://api.github.com/users/fengalin/following{/other_user}","gists_url":"https://api.github.com/users/fengalin/gists{/gist_id}","starred_url":"https://api.github.com/users/fengalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fengalin/subscriptions","organizations_url":"https://api.github.com/users/fengalin/orgs","repos_url":"https://api.github.com/users/fengalin/repos","events_url":"https://api.github.com/users/fengalin/events{/privacy}","received_events_url":"https://api.github.com/users/fengalin/received_events","type":"User","site_admin":false},"body":"When setting an `Object` property with a valid name but an invalid type, `\"Invalid property name\"` is returned. This modification allows returning `\"Invalid property type\"` in this case.\r\n\r\nIn order to avoid breaking existing code, `has_property` is left unchanged.","created_at":"2017-08-17T21:25:47Z","updated_at":"2017-08-17T22:08:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33bcdceebe752915495c3b1857976690342d44c3","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/gtk-rs/glib/pulls/214/commits","review_comments_url":"https://api.github.com/repos/gtk-rs/glib/pulls/214/comments","review_comment_url":"https://api.github.com/repos/gtk-rs/glib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gtk-rs/glib/issues/214/comments","statuses_url":"https://api.github.com/repos/gtk-rs/glib/statuses/4837898a28cb36cacde25f8beca7b328ef627a4a","head":{"label":"fengalin:property_type_error","ref":"property_type_error","sha":"4837898a28cb36cacde25f8beca7b328ef627a4a","user":{"login":"fengalin","id":28687262,"avatar_url":"https://avatars0.githubusercontent.com/u/28687262?v=4","gravatar_id":"","url":"https://api.github.com/users/fengalin","html_url":"https://github.com/fengalin","followers_url":"https://api.github.com/users/fengalin/followers","following_url":"https://api.github.com/users/fengalin/following{/other_user}","gists_url":"https://api.github.com/users/fengalin/gists{/gist_id}","starred_url":"https://api.github.com/users/fengalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fengalin/subscriptions","organizations_url":"https://api.github.com/users/fengalin/orgs","repos_url":"https://api.github.com/users/fengalin/repos","events_url":"https://api.github.com/users/fengalin/events{/privacy}","received_events_url":"https://api.github.com/users/fengalin/received_events","type":"User","site_admin":false},"repo":{"id":100623731,"name":"glib","full_name":"fengalin/glib","owner":{"login":"fengalin","id":28687262,"avatar_url":"https://avatars0.githubusercontent.com/u/28687262?v=4","gravatar_id":"","url":"https://api.github.com/users/fengalin","html_url":"https://github.com/fengalin","followers_url":"https://api.github.com/users/fengalin/followers","following_url":"https://api.github.com/users/fengalin/following{/other_user}","gists_url":"https://api.github.com/users/fengalin/gists{/gist_id}","starred_url":"https://api.github.com/users/fengalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fengalin/subscriptions","organizations_url":"https://api.github.com/users/fengalin/orgs","repos_url":"https://api.github.com/users/fengalin/repos","events_url":"https://api.github.com/users/fengalin/events{/privacy}","received_events_url":"https://api.github.com/users/fengalin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fengalin/glib","description":"GLib bindings for Rust","fork":true,"url":"https://api.github.com/repos/fengalin/glib","forks_url":"https://api.github.com/repos/fengalin/glib/forks","keys_url":"https://api.github.com/repos/fengalin/glib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fengalin/glib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fengalin/glib/teams","hooks_url":"https://api.github.com/repos/fengalin/glib/hooks","issue_events_url":"https://api.github.com/repos/fengalin/glib/issues/events{/number}","events_url":"https://api.github.com/repos/fengalin/glib/events","assignees_url":"https://api.github.com/repos/fengalin/glib/assignees{/user}","branches_url":"https://api.github.com/repos/fengalin/glib/branches{/branch}","tags_url":"https://api.github.com/repos/fengalin/glib/tags","blobs_url":"https://api.github.com/repos/fengalin/glib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fengalin/glib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fengalin/glib/git/refs{/sha}","trees_url":"https://api.github.com/repos/fengalin/glib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fengalin/glib/statuses/{sha}","languages_url":"https://api.github.com/repos/fengalin/glib/languages","stargazers_url":"https://api.github.com/repos/fengalin/glib/stargazers","contributors_url":"https://api.github.com/repos/fengalin/glib/contributors","subscribers_url":"https://api.github.com/repos/fengalin/glib/subscribers","subscription_url":"https://api.github.com/repos/fengalin/glib/subscription","commits_url":"https://api.github.com/repos/fengalin/glib/commits{/sha}","git_commits_url":"https://api.github.com/repos/fengalin/glib/git/commits{/sha}","comments_url":"https://api.github.com/repos/fengalin/glib/comments{/number}","issue_comment_url":"https://api.github.com/repos/fengalin/glib/issues/comments{/number}","contents_url":"https://api.github.com/repos/fengalin/glib/contents/{+path}","compare_url":"https://api.github.com/repos/fengalin/glib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fengalin/glib/merges","archive_url":"https://api.github.com/repos/fengalin/glib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fengalin/glib/downloads","issues_url":"https://api.github.com/repos/fengalin/glib/issues{/number}","pulls_url":"https://api.github.com/repos/fengalin/glib/pulls{/number}","milestones_url":"https://api.github.com/repos/fengalin/glib/milestones{/number}","notifications_url":"https://api.github.com/repos/fengalin/glib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fengalin/glib/labels{/name}","releases_url":"https://api.github.com/repos/fengalin/glib/releases{/id}","deployments_url":"https://api.github.com/repos/fengalin/glib/deployments","created_at":"2017-08-17T16:25:25Z","updated_at":"2017-08-17T16:25:26Z","pushed_at":"2017-08-17T21:24:22Z","git_url":"git://github.com/fengalin/glib.git","ssh_url":"git@github.com:fengalin/glib.git","clone_url":"https://github.com/fengalin/glib.git","svn_url":"https://github.com/fengalin/glib","homepage":"http://gtk-rs.org/","size":3376,"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":"gtk-rs:master","ref":"master","sha":"dc304963b10e8950b71a73ab7c9620c931ef7950","user":{"login":"gtk-rs","id":11757045,"avatar_url":"https://avatars2.githubusercontent.com/u/11757045?v=4","gravatar_id":"","url":"https://api.github.com/users/gtk-rs","html_url":"https://github.com/gtk-rs","followers_url":"https://api.github.com/users/gtk-rs/followers","following_url":"https://api.github.com/users/gtk-rs/following{/other_user}","gists_url":"https://api.github.com/users/gtk-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/gtk-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtk-rs/subscriptions","organizations_url":"https://api.github.com/users/gtk-rs/orgs","repos_url":"https://api.github.com/users/gtk-rs/repos","events_url":"https://api.github.com/users/gtk-rs/events{/privacy}","received_events_url":"https://api.github.com/users/gtk-rs/received_events","type":"Organization","site_admin":false},"repo":{"id":33257546,"name":"glib","full_name":"gtk-rs/glib","owner":{"login":"gtk-rs","id":11757045,"avatar_url":"https://avatars2.githubusercontent.com/u/11757045?v=4","gravatar_id":"","url":"https://api.github.com/users/gtk-rs","html_url":"https://github.com/gtk-rs","followers_url":"https://api.github.com/users/gtk-rs/followers","following_url":"https://api.github.com/users/gtk-rs/following{/other_user}","gists_url":"https://api.github.com/users/gtk-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/gtk-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtk-rs/subscriptions","organizations_url":"https://api.github.com/users/gtk-rs/orgs","repos_url":"https://api.github.com/users/gtk-rs/repos","events_url":"https://api.github.com/users/gtk-rs/events{/privacy}","received_events_url":"https://api.github.com/users/gtk-rs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gtk-rs/glib","description":"GLib bindings for Rust","fork":false,"url":"https://api.github.com/repos/gtk-rs/glib","forks_url":"https://api.github.com/repos/gtk-rs/glib/forks","keys_url":"https://api.github.com/repos/gtk-rs/glib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gtk-rs/glib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gtk-rs/glib/teams","hooks_url":"https://api.github.com/repos/gtk-rs/glib/hooks","issue_events_url":"https://api.github.com/repos/gtk-rs/glib/issues/events{/number}","events_url":"https://api.github.com/repos/gtk-rs/glib/events","assignees_url":"https://api.github.com/repos/gtk-rs/glib/assignees{/user}","branches_url":"https://api.github.com/repos/gtk-rs/glib/branches{/branch}","tags_url":"https://api.github.com/repos/gtk-rs/glib/tags","blobs_url":"https://api.github.com/repos/gtk-rs/glib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gtk-rs/glib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gtk-rs/glib/git/refs{/sha}","trees_url":"https://api.github.com/repos/gtk-rs/glib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gtk-rs/glib/statuses/{sha}","languages_url":"https://api.github.com/repos/gtk-rs/glib/languages","stargazers_url":"https://api.github.com/repos/gtk-rs/glib/stargazers","contributors_url":"https://api.github.com/repos/gtk-rs/glib/contributors","subscribers_url":"https://api.github.com/repos/gtk-rs/glib/subscribers","subscription_url":"https://api.github.com/repos/gtk-rs/glib/subscription","commits_url":"https://api.github.com/repos/gtk-rs/glib/commits{/sha}","git_commits_url":"https://api.github.com/repos/gtk-rs/glib/git/commits{/sha}","comments_url":"https://api.github.com/repos/gtk-rs/glib/comments{/number}","issue_comment_url":"https://api.github.com/repos/gtk-rs/glib/issues/comments{/number}","contents_url":"https://api.github.com/repos/gtk-rs/glib/contents/{+path}","compare_url":"https://api.github.com/repos/gtk-rs/glib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gtk-rs/glib/merges","archive_url":"https://api.github.com/repos/gtk-rs/glib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gtk-rs/glib/downloads","issues_url":"https://api.github.com/repos/gtk-rs/glib/issues{/number}","pulls_url":"https://api.github.com/repos/gtk-rs/glib/pulls{/number}","milestones_url":"https://api.github.com/repos/gtk-rs/glib/milestones{/number}","notifications_url":"https://api.github.com/repos/gtk-rs/glib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gtk-rs/glib/labels{/name}","releases_url":"https://api.github.com/repos/gtk-rs/glib/releases{/id}","deployments_url":"https://api.github.com/repos/gtk-rs/glib/deployments","created_at":"2015-04-01T16:01:03Z","updated_at":"2017-08-12T18:44:27Z","pushed_at":"2017-08-17T21:25:48Z","git_url":"git://github.com/gtk-rs/glib.git","ssh_url":"git@github.com:gtk-rs/glib.git","clone_url":"https://github.com/gtk-rs/glib.git","svn_url":"https://github.com/gtk-rs/glib","homepage":"http://gtk-rs.org/","size":3376,"stargazers_count":11,"watchers_count":11,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":13,"forks":23,"open_issues":13,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gtk-rs/glib/pulls/214"},"html":{"href":"https://github.com/gtk-rs/glib/pull/214"},"issue":{"href":"https://api.github.com/repos/gtk-rs/glib/issues/214"},"comments":{"href":"https://api.github.com/repos/gtk-rs/glib/issues/214/comments"},"review_comments":{"href":"https://api.github.com/repos/gtk-rs/glib/pulls/214/comments"},"review_comment":{"href":"https://api.github.com/repos/gtk-rs/glib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gtk-rs/glib/pulls/214/commits"},"statuses":{"href":"https://api.github.com/repos/gtk-rs/glib/statuses/4837898a28cb36cacde25f8beca7b328ef627a4a"}}}}
{"actor":{"display_login":"fengalin"}}