{"action":"created","comment":{"url":"https://api.github.com/repos/fxbox/taxonomy/pulls/comments/55019504","id":55019504,"diff_hunk":"@@ -67,11 +76,50 @@ impl Type {\n         use self::Type::*;\n         match *self {\n             Duration | TimeStamp | Temperature | ExtNumeric | Color => false,\n-            Unit | Bool | String | Json | Binary => true,\n+            Unit | String | Json | Binary | OnOff | OpenClosed | ExtBool  => true,\n         }\n     }\n }\n \n+/// An on/off state. Internal representation may be either On or Off.\n+#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]\n+pub enum OnOff {\n+    On,\n+    Off,\n+}\n+\n+impl OnOff {","path":"src/values.rs","position":46,"original_position":46,"commit_id":"f318c28609ec848e762cc72b2e2ceccfb5a496fc","original_commit_id":"f318c28609ec848e762cc72b2e2ceccfb5a496fc","user":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars.githubusercontent.com/u/1713708?v=3","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"body":"Aaand few more ```best practices``` questions for you (sorry for too many, just want to have common ground) :)\r\n\r\n* If I delegate ```PartialOrd``` and ```Ord``` implementation to ```#derive``` it won't behave like boolean (```true > false```, but ```OnOff::On < OnOff::Off```), I suspect we want to have boolean-like behavior and should implement ```Ord``` and ```PartialOrd``` manually?\r\n\r\n* Is it ok to implement ```PartialOrd``` via ```Ord``` like:\r\n```\r\nimpl PartialOrd for SomeEnum {\r\n    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {\r\n        Some(self.cmp(other))\r\n    }\r\n}\r\n```\r\n\r\nLooking at the ```Ord``` and ```PartiallyOrd``` hierarchy it seems that more naturally would be to implement it the other way around, ```Ord``` via ```PartialOrd```, but we'll have addition ```unwrap``` call in ```self.partal_cmp(other).unwrap()```.\r\n\r\n* Is it  Ok to use ```catch-all``` clause in two-states enum like this, or we should guard ourselves in case one more state will be added?\r\n```\r\nmatch (self, other) {\r\n    (&OpenClosed::Open, &OpenClosed::Closed) => Greater,\r\n    (&OpenClosed::Closed, &OpenClosed::Open) => Less,\r\n    _ => Equal,\r\n}\r\n```\r\nvs\r\n```\r\nmatch (self, other) {\r\n    (&OpenClosed::Open, &OpenClosed::Closed) => Greater,\r\n    (&OpenClosed::Closed, &OpenClosed::Open) => Less,\r\n    (&OpenClosed::Open, &OpenClosed::Open) => Equal,\r\n    (&OpenClosed::Closed, &OpenClosed::Closed) => Equal,\r\n}\r\n```\r\nor even something crazy :)\r\n```\r\nmatch (self, other, self == other) {\r\n    (_, _, true) => Equal,\r\n    (&OpenClosed::Open, &OpenClosed::Closed, _) => Greater,\r\n    (&OpenClosed::Closed, &OpenClosed::Open, _) => Less,\r\n}\r\n```","created_at":"2016-03-04T11:28:58Z","updated_at":"2016-03-04T11:28:58Z","html_url":"https://github.com/fxbox/taxonomy/pull/15#discussion_r55019504","pull_request_url":"https://api.github.com/repos/fxbox/taxonomy/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/fxbox/taxonomy/pulls/comments/55019504"},"html":{"href":"https://github.com/fxbox/taxonomy/pull/15#discussion_r55019504"},"pull_request":{"href":"https://api.github.com/repos/fxbox/taxonomy/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/fxbox/taxonomy/pulls/15","id":61691885,"html_url":"https://github.com/fxbox/taxonomy/pull/15","diff_url":"https://github.com/fxbox/taxonomy/pull/15.diff","patch_url":"https://github.com/fxbox/taxonomy/pull/15.patch","issue_url":"https://api.github.com/repos/fxbox/taxonomy/issues/15","number":15,"state":"open","locked":false,"title":"Introduce boolean-like value types (fixes #13) - wip.","user":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars.githubusercontent.com/u/1713708?v=3","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"body":"PR to handle https://github.com/fxbox/taxonomy/issues/13","created_at":"2016-03-04T10:17:44Z","updated_at":"2016-03-04T11:28:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c17c6bdfad313d0d6f115567b68634f74924c5fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fxbox/taxonomy/pulls/15/commits","review_comments_url":"https://api.github.com/repos/fxbox/taxonomy/pulls/15/comments","review_comment_url":"https://api.github.com/repos/fxbox/taxonomy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fxbox/taxonomy/issues/15/comments","statuses_url":"https://api.github.com/repos/fxbox/taxonomy/statuses/f318c28609ec848e762cc72b2e2ceccfb5a496fc","head":{"label":"azasypkin:boolean-values","ref":"boolean-values","sha":"f318c28609ec848e762cc72b2e2ceccfb5a496fc","user":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars.githubusercontent.com/u/1713708?v=3","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"repo":{"id":53041369,"name":"taxonomy","full_name":"azasypkin/taxonomy","owner":{"login":"azasypkin","id":1713708,"avatar_url":"https://avatars.githubusercontent.com/u/1713708?v=3","gravatar_id":"","url":"https://api.github.com/users/azasypkin","html_url":"https://github.com/azasypkin","followers_url":"https://api.github.com/users/azasypkin/followers","following_url":"https://api.github.com/users/azasypkin/following{/other_user}","gists_url":"https://api.github.com/users/azasypkin/gists{/gist_id}","starred_url":"https://api.github.com/users/azasypkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azasypkin/subscriptions","organizations_url":"https://api.github.com/users/azasypkin/orgs","repos_url":"https://api.github.com/users/azasypkin/repos","events_url":"https://api.github.com/users/azasypkin/events{/privacy}","received_events_url":"https://api.github.com/users/azasypkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/azasypkin/taxonomy","description":"Shared implementation of the taxonomy data structures","fork":true,"url":"https://api.github.com/repos/azasypkin/taxonomy","forks_url":"https://api.github.com/repos/azasypkin/taxonomy/forks","keys_url":"https://api.github.com/repos/azasypkin/taxonomy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azasypkin/taxonomy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azasypkin/taxonomy/teams","hooks_url":"https://api.github.com/repos/azasypkin/taxonomy/hooks","issue_events_url":"https://api.github.com/repos/azasypkin/taxonomy/issues/events{/number}","events_url":"https://api.github.com/repos/azasypkin/taxonomy/events","assignees_url":"https://api.github.com/repos/azasypkin/taxonomy/assignees{/user}","branches_url":"https://api.github.com/repos/azasypkin/taxonomy/branches{/branch}","tags_url":"https://api.github.com/repos/azasypkin/taxonomy/tags","blobs_url":"https://api.github.com/repos/azasypkin/taxonomy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azasypkin/taxonomy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azasypkin/taxonomy/git/refs{/sha}","trees_url":"https://api.github.com/repos/azasypkin/taxonomy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azasypkin/taxonomy/statuses/{sha}","languages_url":"https://api.github.com/repos/azasypkin/taxonomy/languages","stargazers_url":"https://api.github.com/repos/azasypkin/taxonomy/stargazers","contributors_url":"https://api.github.com/repos/azasypkin/taxonomy/contributors","subscribers_url":"https://api.github.com/repos/azasypkin/taxonomy/subscribers","subscription_url":"https://api.github.com/repos/azasypkin/taxonomy/subscription","commits_url":"https://api.github.com/repos/azasypkin/taxonomy/commits{/sha}","git_commits_url":"https://api.github.com/repos/azasypkin/taxonomy/git/commits{/sha}","comments_url":"https://api.github.com/repos/azasypkin/taxonomy/comments{/number}","issue_comment_url":"https://api.github.com/repos/azasypkin/taxonomy/issues/comments{/number}","contents_url":"https://api.github.com/repos/azasypkin/taxonomy/contents/{+path}","compare_url":"https://api.github.com/repos/azasypkin/taxonomy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azasypkin/taxonomy/merges","archive_url":"https://api.github.com/repos/azasypkin/taxonomy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azasypkin/taxonomy/downloads","issues_url":"https://api.github.com/repos/azasypkin/taxonomy/issues{/number}","pulls_url":"https://api.github.com/repos/azasypkin/taxonomy/pulls{/number}","milestones_url":"https://api.github.com/repos/azasypkin/taxonomy/milestones{/number}","notifications_url":"https://api.github.com/repos/azasypkin/taxonomy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azasypkin/taxonomy/labels{/name}","releases_url":"https://api.github.com/repos/azasypkin/taxonomy/releases{/id}","deployments_url":"https://api.github.com/repos/azasypkin/taxonomy/deployments","created_at":"2016-03-03T10:19:44Z","updated_at":"2016-03-03T10:19:45Z","pushed_at":"2016-03-04T10:15:57Z","git_url":"git://github.com/azasypkin/taxonomy.git","ssh_url":"git@github.com:azasypkin/taxonomy.git","clone_url":"https://github.com/azasypkin/taxonomy.git","svn_url":"https://github.com/azasypkin/taxonomy","homepage":"http://fxbox.github.io/taxonomy/doc/fxbox_taxonomy/index.html","size":2500,"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":"fxbox:master","ref":"master","sha":"e7e6981a43d60bfd532006f8d7df10d1e2dadb6e","user":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"repo":{"id":51984224,"name":"taxonomy","full_name":"fxbox/taxonomy","owner":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fxbox/taxonomy","description":"Shared implementation of the taxonomy data structures","fork":false,"url":"https://api.github.com/repos/fxbox/taxonomy","forks_url":"https://api.github.com/repos/fxbox/taxonomy/forks","keys_url":"https://api.github.com/repos/fxbox/taxonomy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fxbox/taxonomy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fxbox/taxonomy/teams","hooks_url":"https://api.github.com/repos/fxbox/taxonomy/hooks","issue_events_url":"https://api.github.com/repos/fxbox/taxonomy/issues/events{/number}","events_url":"https://api.github.com/repos/fxbox/taxonomy/events","assignees_url":"https://api.github.com/repos/fxbox/taxonomy/assignees{/user}","branches_url":"https://api.github.com/repos/fxbox/taxonomy/branches{/branch}","tags_url":"https://api.github.com/repos/fxbox/taxonomy/tags","blobs_url":"https://api.github.com/repos/fxbox/taxonomy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fxbox/taxonomy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fxbox/taxonomy/git/refs{/sha}","trees_url":"https://api.github.com/repos/fxbox/taxonomy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fxbox/taxonomy/statuses/{sha}","languages_url":"https://api.github.com/repos/fxbox/taxonomy/languages","stargazers_url":"https://api.github.com/repos/fxbox/taxonomy/stargazers","contributors_url":"https://api.github.com/repos/fxbox/taxonomy/contributors","subscribers_url":"https://api.github.com/repos/fxbox/taxonomy/subscribers","subscription_url":"https://api.github.com/repos/fxbox/taxonomy/subscription","commits_url":"https://api.github.com/repos/fxbox/taxonomy/commits{/sha}","git_commits_url":"https://api.github.com/repos/fxbox/taxonomy/git/commits{/sha}","comments_url":"https://api.github.com/repos/fxbox/taxonomy/comments{/number}","issue_comment_url":"https://api.github.com/repos/fxbox/taxonomy/issues/comments{/number}","contents_url":"https://api.github.com/repos/fxbox/taxonomy/contents/{+path}","compare_url":"https://api.github.com/repos/fxbox/taxonomy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fxbox/taxonomy/merges","archive_url":"https://api.github.com/repos/fxbox/taxonomy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fxbox/taxonomy/downloads","issues_url":"https://api.github.com/repos/fxbox/taxonomy/issues{/number}","pulls_url":"https://api.github.com/repos/fxbox/taxonomy/pulls{/number}","milestones_url":"https://api.github.com/repos/fxbox/taxonomy/milestones{/number}","notifications_url":"https://api.github.com/repos/fxbox/taxonomy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fxbox/taxonomy/labels{/name}","releases_url":"https://api.github.com/repos/fxbox/taxonomy/releases{/id}","deployments_url":"https://api.github.com/repos/fxbox/taxonomy/deployments","created_at":"2016-02-18T06:18:25Z","updated_at":"2016-02-23T16:11:07Z","pushed_at":"2016-03-04T10:17:45Z","git_url":"git://github.com/fxbox/taxonomy.git","ssh_url":"git@github.com:fxbox/taxonomy.git","clone_url":"https://github.com/fxbox/taxonomy.git","svn_url":"https://github.com/fxbox/taxonomy","homepage":"http://fxbox.github.io/taxonomy/doc/fxbox_taxonomy/index.html","size":2499,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fxbox/taxonomy/pulls/15"},"html":{"href":"https://github.com/fxbox/taxonomy/pull/15"},"issue":{"href":"https://api.github.com/repos/fxbox/taxonomy/issues/15"},"comments":{"href":"https://api.github.com/repos/fxbox/taxonomy/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/fxbox/taxonomy/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/fxbox/taxonomy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fxbox/taxonomy/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/fxbox/taxonomy/statuses/f318c28609ec848e762cc72b2e2ceccfb5a496fc"}}}}