{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/152846709","pull_request_review_id":78771869,"id":152846709,"diff_hunk":"@@ -646,6 +647,24 @@ impl From<CString> for Vec<u8> {\n     }\n }\n \n+#[unstable(feature = \"try_from\", issue = \"33417\")]\n+impl<T: Into<Vec<u8>>> TryFrom<T> for CString {\n+    type Error = NulError;\n+\n+    fn try_from(t: T) -> Result<CString, NulError> {\n+        CString::new(t)\n+    }\n+}\n+\n+#[unstable(feature = \"try_from\", issue = \"33417\")]\n+impl TryFrom<CString> for String {\n+    type Error = IntoStringError;\n+\n+    fn try_from(c_str: CString) -> Result<String, IntoStringError> {\n+        c_str.into_string()","path":"src/libstd/ffi/c_str.rs","position":26,"original_position":26,"commit_id":"26c0efeff513d056db87d3d0303caebecc687ffa","original_commit_id":"7b97def8e4401cd7d043d965ea66152a255ba30e","user":{"login":"nvzqz","id":10367662,"avatar_url":"https://avatars0.githubusercontent.com/u/10367662?v=4","gravatar_id":"","url":"https://api.github.com/users/nvzqz","html_url":"https://github.com/nvzqz","followers_url":"https://api.github.com/users/nvzqz/followers","following_url":"https://api.github.com/users/nvzqz/following{/other_user}","gists_url":"https://api.github.com/users/nvzqz/gists{/gist_id}","starred_url":"https://api.github.com/users/nvzqz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvzqz/subscriptions","organizations_url":"https://api.github.com/users/nvzqz/orgs","repos_url":"https://api.github.com/users/nvzqz/repos","events_url":"https://api.github.com/users/nvzqz/events{/privacy}","received_events_url":"https://api.github.com/users/nvzqz/received_events","type":"User","site_admin":false},"body":"@kennytm @sfackler do you guys have any input on this?","created_at":"2017-11-23T16:59:03Z","updated_at":"2017-11-23T16:59:03Z","html_url":"https://github.com/rust-lang/rust/pull/44916#discussion_r152846709","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/44916","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/152846709"},"html":{"href":"https://github.com/rust-lang/rust/pull/44916#discussion_r152846709"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/44916"}},"in_reply_to_id":150303436},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/44916","id":143811303,"html_url":"https://github.com/rust-lang/rust/pull/44916","diff_url":"https://github.com/rust-lang/rust/pull/44916.diff","patch_url":"https://github.com/rust-lang/rust/pull/44916.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/44916","number":44916,"state":"open","locked":false,"title":"Implement TryFrom for String Types","user":{"login":"nvzqz","id":10367662,"avatar_url":"https://avatars0.githubusercontent.com/u/10367662?v=4","gravatar_id":"","url":"https://api.github.com/users/nvzqz","html_url":"https://github.com/nvzqz","followers_url":"https://api.github.com/users/nvzqz/followers","following_url":"https://api.github.com/users/nvzqz/following{/other_user}","gists_url":"https://api.github.com/users/nvzqz/gists{/gist_id}","starred_url":"https://api.github.com/users/nvzqz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvzqz/subscriptions","organizations_url":"https://api.github.com/users/nvzqz/orgs","repos_url":"https://api.github.com/users/nvzqz/repos","events_url":"https://api.github.com/users/nvzqz/events{/privacy}","received_events_url":"https://api.github.com/users/nvzqz/received_events","type":"User","site_admin":false},"body":"Implements `TryFrom` by utilizing the available conversions.\r\n\r\nThis is a subset of #33417.\r\n\r\n## Conversions\r\n\r\n| From              | Into          | Kind              |\r\n| :---------------- | :------------ | :---------------- |\r\n| ~~`&{mut,} [u8]`~~    | ~~`&{mut,} str`~~ | ~~UTF-8~~             |\r\n| ~~`Vec<u8>`~~         | ~~`String`~~      | ~~UTF-8~~             |\r\n| ~~`&[u16]`~~          | ~~`String`~~      | ~~UTF-16~~            |\r\n| `&[u8]`           | `&CStr`       | UTF-8 with nul    |\r\n| `CString`         | `String`      | UTF-8             |\r\n| `Into<Vec<u8>>`   | `CString`     | UTF-8 with nul    |\r\n\r\n## Motivation\r\nThese types already have conversions that return `Result<Self, Error>`. This simply implements `TryFrom` for such types.","created_at":"2017-09-29T05:42:25Z","updated_at":"2017-11-23T16:59:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18997dab0b0d3e65af98f6225cf4b0492f3eaba9","assignee":{"login":"sfackler","id":1455697,"avatar_url":"https://avatars0.githubusercontent.com/u/1455697?v=4","gravatar_id":"","url":"https://api.github.com/users/sfackler","html_url":"https://github.com/sfackler","followers_url":"https://api.github.com/users/sfackler/followers","following_url":"https://api.github.com/users/sfackler/following{/other_user}","gists_url":"https://api.github.com/users/sfackler/gists{/gist_id}","starred_url":"https://api.github.com/users/sfackler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfackler/subscriptions","organizations_url":"https://api.github.com/users/sfackler/orgs","repos_url":"https://api.github.com/users/sfackler/repos","events_url":"https://api.github.com/users/sfackler/events{/privacy}","received_events_url":"https://api.github.com/users/sfackler/received_events","type":"User","site_admin":false},"assignees":[{"login":"sfackler","id":1455697,"avatar_url":"https://avatars0.githubusercontent.com/u/1455697?v=4","gravatar_id":"","url":"https://api.github.com/users/sfackler","html_url":"https://github.com/sfackler","followers_url":"https://api.github.com/users/sfackler/followers","following_url":"https://api.github.com/users/sfackler/following{/other_user}","gists_url":"https://api.github.com/users/sfackler/gists{/gist_id}","starred_url":"https://api.github.com/users/sfackler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfackler/subscriptions","organizations_url":"https://api.github.com/users/sfackler/orgs","repos_url":"https://api.github.com/users/sfackler/repos","events_url":"https://api.github.com/users/sfackler/events{/privacy}","received_events_url":"https://api.github.com/users/sfackler/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/44916/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/44916/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/44916/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/26c0efeff513d056db87d3d0303caebecc687ffa","head":{"label":"nvzqz:str-try-from","ref":"str-try-from","sha":"26c0efeff513d056db87d3d0303caebecc687ffa","user":{"login":"nvzqz","id":10367662,"avatar_url":"https://avatars0.githubusercontent.com/u/10367662?v=4","gravatar_id":"","url":"https://api.github.com/users/nvzqz","html_url":"https://github.com/nvzqz","followers_url":"https://api.github.com/users/nvzqz/followers","following_url":"https://api.github.com/users/nvzqz/following{/other_user}","gists_url":"https://api.github.com/users/nvzqz/gists{/gist_id}","starred_url":"https://api.github.com/users/nvzqz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvzqz/subscriptions","organizations_url":"https://api.github.com/users/nvzqz/orgs","repos_url":"https://api.github.com/users/nvzqz/repos","events_url":"https://api.github.com/users/nvzqz/events{/privacy}","received_events_url":"https://api.github.com/users/nvzqz/received_events","type":"User","site_admin":false},"repo":{"id":100758313,"name":"rust","full_name":"nvzqz/rust","owner":{"login":"nvzqz","id":10367662,"avatar_url":"https://avatars0.githubusercontent.com/u/10367662?v=4","gravatar_id":"","url":"https://api.github.com/users/nvzqz","html_url":"https://github.com/nvzqz","followers_url":"https://api.github.com/users/nvzqz/followers","following_url":"https://api.github.com/users/nvzqz/following{/other_user}","gists_url":"https://api.github.com/users/nvzqz/gists{/gist_id}","starred_url":"https://api.github.com/users/nvzqz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvzqz/subscriptions","organizations_url":"https://api.github.com/users/nvzqz/orgs","repos_url":"https://api.github.com/users/nvzqz/repos","events_url":"https://api.github.com/users/nvzqz/events{/privacy}","received_events_url":"https://api.github.com/users/nvzqz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nvzqz/rust","description":"A safe, concurrent, practical language.","fork":true,"url":"https://api.github.com/repos/nvzqz/rust","forks_url":"https://api.github.com/repos/nvzqz/rust/forks","keys_url":"https://api.github.com/repos/nvzqz/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nvzqz/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nvzqz/rust/teams","hooks_url":"https://api.github.com/repos/nvzqz/rust/hooks","issue_events_url":"https://api.github.com/repos/nvzqz/rust/issues/events{/number}","events_url":"https://api.github.com/repos/nvzqz/rust/events","assignees_url":"https://api.github.com/repos/nvzqz/rust/assignees{/user}","branches_url":"https://api.github.com/repos/nvzqz/rust/branches{/branch}","tags_url":"https://api.github.com/repos/nvzqz/rust/tags","blobs_url":"https://api.github.com/repos/nvzqz/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nvzqz/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nvzqz/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/nvzqz/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nvzqz/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/nvzqz/rust/languages","stargazers_url":"https://api.github.com/repos/nvzqz/rust/stargazers","contributors_url":"https://api.github.com/repos/nvzqz/rust/contributors","subscribers_url":"https://api.github.com/repos/nvzqz/rust/subscribers","subscription_url":"https://api.github.com/repos/nvzqz/rust/subscription","commits_url":"https://api.github.com/repos/nvzqz/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/nvzqz/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/nvzqz/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/nvzqz/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/nvzqz/rust/contents/{+path}","compare_url":"https://api.github.com/repos/nvzqz/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nvzqz/rust/merges","archive_url":"https://api.github.com/repos/nvzqz/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nvzqz/rust/downloads","issues_url":"https://api.github.com/repos/nvzqz/rust/issues{/number}","pulls_url":"https://api.github.com/repos/nvzqz/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/nvzqz/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/nvzqz/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nvzqz/rust/labels{/name}","releases_url":"https://api.github.com/repos/nvzqz/rust/releases{/id}","deployments_url":"https://api.github.com/repos/nvzqz/rust/deployments","created_at":"2017-08-18T23:59:48Z","updated_at":"2017-08-19T00:00:11Z","pushed_at":"2017-11-23T16:56:21Z","git_url":"git://github.com/nvzqz/rust.git","ssh_url":"git@github.com:nvzqz/rust.git","clone_url":"https://github.com/nvzqz/rust.git","svn_url":"https://github.com/nvzqz/rust","homepage":"https://www.rust-lang.org","size":332475,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"b9b82fde7c72e47bd76829bd5322f427bf3f9900","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars1.githubusercontent.com/u/5430905?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rust","description":"A safe, concurrent, practical language.","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/rust/deployments","created_at":"2010-06-16T20:39:03Z","updated_at":"2017-11-23T16:38:17Z","pushed_at":"2017-11-23T16:56:24Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"https://www.rust-lang.org","size":334609,"stargazers_count":24798,"watchers_count":24798,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4521,"mirror_url":null,"archived":false,"open_issues_count":3050,"forks":4521,"open_issues":3050,"watchers":24798,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/44916"},"html":{"href":"https://github.com/rust-lang/rust/pull/44916"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/44916"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/44916/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/44916/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/44916/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/26c0efeff513d056db87d3d0303caebecc687ffa"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nvzqz"}}