{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/comments/184886545","pull_request_review_id":116169997,"id":184886545,"diff_hunk":"@@ -688,6 +689,53 @@ fn run() -> Result<()> {\n # quick_main!(run);\n ```\n \n+[ex-mime-from-string]: #ex-mime-from-string\n+<a name=\"ex-mime-from-string\"></a>\n+## Get MIME type from string\n+\n+[![mime-badge]][mime] [![cat-encoding-badge]][cat-encoding]\n+\n+The following example shows how to parse a [`MIME`] type from a string using the [mime] crate. You can handle a possible [`FromStrError`] by providing a default [`MIME`] type in an `unwrap_or` clause.\n+\n+```rust\n+# #[macro_use]","path":"src/encoding.md","position":21,"original_position":21,"commit_id":"0f429e38dab6de1c759358c969c928d24d6db595","original_commit_id":"0f429e38dab6de1c759358c969c928d24d6db595","user":{"login":"AndyGauge","id":6525150,"avatar_url":"https://avatars1.githubusercontent.com/u/6525150?v=4","gravatar_id":"","url":"https://api.github.com/users/AndyGauge","html_url":"https://github.com/AndyGauge","followers_url":"https://api.github.com/users/AndyGauge/followers","following_url":"https://api.github.com/users/AndyGauge/following{/other_user}","gists_url":"https://api.github.com/users/AndyGauge/gists{/gist_id}","starred_url":"https://api.github.com/users/AndyGauge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndyGauge/subscriptions","organizations_url":"https://api.github.com/users/AndyGauge/orgs","repos_url":"https://api.github.com/users/AndyGauge/repos","events_url":"https://api.github.com/users/AndyGauge/events{/privacy}","received_events_url":"https://api.github.com/users/AndyGauge/received_events","type":"User","site_admin":false},"body":"In this example there is no error handling (you are demonstrating how to explicitly handle the error in fact) so there is no need for the error_chain crate in this example.  You can remove lines 701-703,705-711, 733,736.","created_at":"2018-04-29T15:25:15Z","updated_at":"2018-04-29T15:26:28Z","html_url":"https://github.com/rust-lang-nursery/rust-cookbook/pull/406#discussion_r184886545","pull_request_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/406","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/comments/184886545"},"html":{"href":"https://github.com/rust-lang-nursery/rust-cookbook/pull/406#discussion_r184886545"},"pull_request":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/406"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/406","id":184815589,"html_url":"https://github.com/rust-lang-nursery/rust-cookbook/pull/406","diff_url":"https://github.com/rust-lang-nursery/rust-cookbook/pull/406.diff","patch_url":"https://github.com/rust-lang-nursery/rust-cookbook/pull/406.patch","issue_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/issues/406","number":406,"state":"open","locked":false,"title":"Add example of MIME from string","user":{"login":"math-foo","id":1373644,"avatar_url":"https://avatars2.githubusercontent.com/u/1373644?v=4","gravatar_id":"","url":"https://api.github.com/users/math-foo","html_url":"https://github.com/math-foo","followers_url":"https://api.github.com/users/math-foo/followers","following_url":"https://api.github.com/users/math-foo/following{/other_user}","gists_url":"https://api.github.com/users/math-foo/gists{/gist_id}","starred_url":"https://api.github.com/users/math-foo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/math-foo/subscriptions","organizations_url":"https://api.github.com/users/math-foo/orgs","repos_url":"https://api.github.com/users/math-foo/repos","events_url":"https://api.github.com/users/math-foo/events{/privacy}","received_events_url":"https://api.github.com/users/math-foo/received_events","type":"User","site_admin":false},"body":"fixes #398","created_at":"2018-04-29T02:56:43Z","updated_at":"2018-04-29T15:26:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2de71711dc0622a78311e96c37e36c1da09096b9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/406/commits","review_comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/406/comments","review_comment_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/issues/406/comments","statuses_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/statuses/0f429e38dab6de1c759358c969c928d24d6db595","head":{"label":"math-foo:mime-from-string","ref":"mime-from-string","sha":"0f429e38dab6de1c759358c969c928d24d6db595","user":{"login":"math-foo","id":1373644,"avatar_url":"https://avatars2.githubusercontent.com/u/1373644?v=4","gravatar_id":"","url":"https://api.github.com/users/math-foo","html_url":"https://github.com/math-foo","followers_url":"https://api.github.com/users/math-foo/followers","following_url":"https://api.github.com/users/math-foo/following{/other_user}","gists_url":"https://api.github.com/users/math-foo/gists{/gist_id}","starred_url":"https://api.github.com/users/math-foo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/math-foo/subscriptions","organizations_url":"https://api.github.com/users/math-foo/orgs","repos_url":"https://api.github.com/users/math-foo/repos","events_url":"https://api.github.com/users/math-foo/events{/privacy}","received_events_url":"https://api.github.com/users/math-foo/received_events","type":"User","site_admin":false},"repo":{"id":131460014,"name":"rust-cookbook","full_name":"math-foo/rust-cookbook","owner":{"login":"math-foo","id":1373644,"avatar_url":"https://avatars2.githubusercontent.com/u/1373644?v=4","gravatar_id":"","url":"https://api.github.com/users/math-foo","html_url":"https://github.com/math-foo","followers_url":"https://api.github.com/users/math-foo/followers","following_url":"https://api.github.com/users/math-foo/following{/other_user}","gists_url":"https://api.github.com/users/math-foo/gists{/gist_id}","starred_url":"https://api.github.com/users/math-foo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/math-foo/subscriptions","organizations_url":"https://api.github.com/users/math-foo/orgs","repos_url":"https://api.github.com/users/math-foo/repos","events_url":"https://api.github.com/users/math-foo/events{/privacy}","received_events_url":"https://api.github.com/users/math-foo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/math-foo/rust-cookbook","description":"https://rust-lang-nursery.github.io/rust-cookbook","fork":true,"url":"https://api.github.com/repos/math-foo/rust-cookbook","forks_url":"https://api.github.com/repos/math-foo/rust-cookbook/forks","keys_url":"https://api.github.com/repos/math-foo/rust-cookbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/math-foo/rust-cookbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/math-foo/rust-cookbook/teams","hooks_url":"https://api.github.com/repos/math-foo/rust-cookbook/hooks","issue_events_url":"https://api.github.com/repos/math-foo/rust-cookbook/issues/events{/number}","events_url":"https://api.github.com/repos/math-foo/rust-cookbook/events","assignees_url":"https://api.github.com/repos/math-foo/rust-cookbook/assignees{/user}","branches_url":"https://api.github.com/repos/math-foo/rust-cookbook/branches{/branch}","tags_url":"https://api.github.com/repos/math-foo/rust-cookbook/tags","blobs_url":"https://api.github.com/repos/math-foo/rust-cookbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/math-foo/rust-cookbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/math-foo/rust-cookbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/math-foo/rust-cookbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/math-foo/rust-cookbook/statuses/{sha}","languages_url":"https://api.github.com/repos/math-foo/rust-cookbook/languages","stargazers_url":"https://api.github.com/repos/math-foo/rust-cookbook/stargazers","contributors_url":"https://api.github.com/repos/math-foo/rust-cookbook/contributors","subscribers_url":"https://api.github.com/repos/math-foo/rust-cookbook/subscribers","subscription_url":"https://api.github.com/repos/math-foo/rust-cookbook/subscription","commits_url":"https://api.github.com/repos/math-foo/rust-cookbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/math-foo/rust-cookbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/math-foo/rust-cookbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/math-foo/rust-cookbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/math-foo/rust-cookbook/contents/{+path}","compare_url":"https://api.github.com/repos/math-foo/rust-cookbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/math-foo/rust-cookbook/merges","archive_url":"https://api.github.com/repos/math-foo/rust-cookbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/math-foo/rust-cookbook/downloads","issues_url":"https://api.github.com/repos/math-foo/rust-cookbook/issues{/number}","pulls_url":"https://api.github.com/repos/math-foo/rust-cookbook/pulls{/number}","milestones_url":"https://api.github.com/repos/math-foo/rust-cookbook/milestones{/number}","notifications_url":"https://api.github.com/repos/math-foo/rust-cookbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/math-foo/rust-cookbook/labels{/name}","releases_url":"https://api.github.com/repos/math-foo/rust-cookbook/releases{/id}","deployments_url":"https://api.github.com/repos/math-foo/rust-cookbook/deployments","created_at":"2018-04-29T02:31:15Z","updated_at":"2018-04-29T02:31:17Z","pushed_at":"2018-04-29T02:54:41Z","git_url":"git://github.com/math-foo/rust-cookbook.git","ssh_url":"git@github.com:math-foo/rust-cookbook.git","clone_url":"https://github.com/math-foo/rust-cookbook.git","svn_url":"https://github.com/math-foo/rust-cookbook","homepage":"","size":1370,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"cc0-1.0","name":"Creative Commons Zero v1.0 Universal","spdx_id":"CC0-1.0","url":"https://api.github.com/licenses/cc0-1.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang-nursery:master","ref":"master","sha":"885130c73f6c0f3aca53ddb4a4d16203c29258a6","user":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"repo":{"id":82722984,"name":"rust-cookbook","full_name":"rust-lang-nursery/rust-cookbook","owner":{"login":"rust-lang-nursery","id":14631425,"avatar_url":"https://avatars1.githubusercontent.com/u/14631425?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-lang-nursery","html_url":"https://github.com/rust-lang-nursery","followers_url":"https://api.github.com/users/rust-lang-nursery/followers","following_url":"https://api.github.com/users/rust-lang-nursery/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang-nursery/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang-nursery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang-nursery/subscriptions","organizations_url":"https://api.github.com/users/rust-lang-nursery/orgs","repos_url":"https://api.github.com/users/rust-lang-nursery/repos","events_url":"https://api.github.com/users/rust-lang-nursery/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang-nursery/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang-nursery/rust-cookbook","description":"https://rust-lang-nursery.github.io/rust-cookbook","fork":false,"url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook","forks_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/forks","keys_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/teams","hooks_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/hooks","issue_events_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/events","assignees_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/tags","blobs_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/languages","stargazers_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/stargazers","contributors_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/contributors","subscribers_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/subscribers","subscription_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/subscription","commits_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/merges","archive_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/downloads","issues_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/deployments","created_at":"2017-02-21T20:17:58Z","updated_at":"2018-04-29T13:14:42Z","pushed_at":"2018-04-29T02:56:44Z","git_url":"git://github.com/rust-lang-nursery/rust-cookbook.git","ssh_url":"git@github.com:rust-lang-nursery/rust-cookbook.git","clone_url":"https://github.com/rust-lang-nursery/rust-cookbook.git","svn_url":"https://github.com/rust-lang-nursery/rust-cookbook","homepage":"","size":1368,"stargazers_count":521,"watchers_count":521,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":107,"mirror_url":null,"archived":false,"open_issues_count":46,"license":{"key":"cc0-1.0","name":"Creative Commons Zero v1.0 Universal","spdx_id":"CC0-1.0","url":"https://api.github.com/licenses/cc0-1.0"},"forks":107,"open_issues":46,"watchers":521,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/406"},"html":{"href":"https://github.com/rust-lang-nursery/rust-cookbook/pull/406"},"issue":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/issues/406"},"comments":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/issues/406/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/406/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/pulls/406/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang-nursery/rust-cookbook/statuses/0f429e38dab6de1c759358c969c928d24d6db595"}},"author_association":"NONE"}}
{"actor":{"display_login":"AndyGauge"}}