{"action":"created","comment":{"url":"https://api.github.com/repos/Antti/rust-amqp/pulls/comments/35956101","id":35956101,"diff_hunk":"@@ -58,6 +58,12 @@ impl Session {\n     /// `\"amqp://localhost/\"` and it will connect to rabbitmq server, running on `localhost` on port `65535`,\n     /// with login `\"guest\"`, password: `\"guest\"` to vhost `\"/\"`\n     pub fn open_url(url_string: &str) -> AMQPResult<Session> {\n+        fn decode(string: &str) -> String {\n+            let input: Vec<u8> = string.bytes().collect();","path":"src/session.rs","position":14,"original_position":14,"commit_id":"3336a86de13d3270f2504fe2e4ed353a088e232c","original_commit_id":"3336a86de13d3270f2504fe2e4ed353a088e232c","user":{"login":"Antti","id":29559,"avatar_url":"https://avatars.githubusercontent.com/u/29559?v=3","gravatar_id":"","url":"https://api.github.com/users/Antti","html_url":"https://github.com/Antti","followers_url":"https://api.github.com/users/Antti/followers","following_url":"https://api.github.com/users/Antti/following{/other_user}","gists_url":"https://api.github.com/users/Antti/gists{/gist_id}","starred_url":"https://api.github.com/users/Antti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antti/subscriptions","organizations_url":"https://api.github.com/users/Antti/orgs","repos_url":"https://api.github.com/users/Antti/repos","events_url":"https://api.github.com/users/Antti/events{/privacy}","received_events_url":"https://api.github.com/users/Antti/received_events","type":"User","site_admin":false},"body":"You can do: `string.as_bytes()`, which will give you &str directly.\r\nAnd also we might want to do lossy_utf8_percent_decode or return Option<String>,\r\nSo basically it will become:\r\n```rust\r\nlet input = string.as_bytes();\r\npercent_encoding::lossy_utf8_percent_decode(input)\r\n```","created_at":"2015-07-31T08:43:21Z","updated_at":"2015-07-31T08:43:21Z","html_url":"https://github.com/Antti/rust-amqp/pull/6#discussion_r35956101","pull_request_url":"https://api.github.com/repos/Antti/rust-amqp/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/Antti/rust-amqp/pulls/comments/35956101"},"html":{"href":"https://github.com/Antti/rust-amqp/pull/6#discussion_r35956101"},"pull_request":{"href":"https://api.github.com/repos/Antti/rust-amqp/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/Antti/rust-amqp/pulls/6","id":41245979,"html_url":"https://github.com/Antti/rust-amqp/pull/6","diff_url":"https://github.com/Antti/rust-amqp/pull/6.diff","patch_url":"https://github.com/Antti/rust-amqp/pull/6.patch","issue_url":"https://api.github.com/repos/Antti/rust-amqp/issues/6","number":6,"state":"open","locked":false,"title":"Percent-decode login & password in Session::open_url","user":{"login":"divarvel","id":173299,"avatar_url":"https://avatars.githubusercontent.com/u/173299?v=3","gravatar_id":"","url":"https://api.github.com/users/divarvel","html_url":"https://github.com/divarvel","followers_url":"https://api.github.com/users/divarvel/followers","following_url":"https://api.github.com/users/divarvel/following{/other_user}","gists_url":"https://api.github.com/users/divarvel/gists{/gist_id}","starred_url":"https://api.github.com/users/divarvel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divarvel/subscriptions","organizations_url":"https://api.github.com/users/divarvel/orgs","repos_url":"https://api.github.com/users/divarvel/repos","events_url":"https://api.github.com/users/divarvel/events{/privacy}","received_events_url":"https://api.github.com/users/divarvel/received_events","type":"User","site_admin":false},"body":"`UrlParser` does not decode them (it makes sure they're encoded).","created_at":"2015-07-30T15:17:39Z","updated_at":"2015-07-31T08:43:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00b217be9aa35b82a3adcb86cd1fd9b0386d9c77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Antti/rust-amqp/pulls/6/commits","review_comments_url":"https://api.github.com/repos/Antti/rust-amqp/pulls/6/comments","review_comment_url":"https://api.github.com/repos/Antti/rust-amqp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Antti/rust-amqp/issues/6/comments","statuses_url":"https://api.github.com/repos/Antti/rust-amqp/statuses/3336a86de13d3270f2504fe2e4ed353a088e232c","head":{"label":"divarvel:url-decode-authority","ref":"url-decode-authority","sha":"3336a86de13d3270f2504fe2e4ed353a088e232c","user":{"login":"divarvel","id":173299,"avatar_url":"https://avatars.githubusercontent.com/u/173299?v=3","gravatar_id":"","url":"https://api.github.com/users/divarvel","html_url":"https://github.com/divarvel","followers_url":"https://api.github.com/users/divarvel/followers","following_url":"https://api.github.com/users/divarvel/following{/other_user}","gists_url":"https://api.github.com/users/divarvel/gists{/gist_id}","starred_url":"https://api.github.com/users/divarvel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divarvel/subscriptions","organizations_url":"https://api.github.com/users/divarvel/orgs","repos_url":"https://api.github.com/users/divarvel/repos","events_url":"https://api.github.com/users/divarvel/events{/privacy}","received_events_url":"https://api.github.com/users/divarvel/received_events","type":"User","site_admin":false},"repo":{"id":39956688,"name":"rust-amqp","full_name":"divarvel/rust-amqp","owner":{"login":"divarvel","id":173299,"avatar_url":"https://avatars.githubusercontent.com/u/173299?v=3","gravatar_id":"","url":"https://api.github.com/users/divarvel","html_url":"https://github.com/divarvel","followers_url":"https://api.github.com/users/divarvel/followers","following_url":"https://api.github.com/users/divarvel/following{/other_user}","gists_url":"https://api.github.com/users/divarvel/gists{/gist_id}","starred_url":"https://api.github.com/users/divarvel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/divarvel/subscriptions","organizations_url":"https://api.github.com/users/divarvel/orgs","repos_url":"https://api.github.com/users/divarvel/repos","events_url":"https://api.github.com/users/divarvel/events{/privacy}","received_events_url":"https://api.github.com/users/divarvel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/divarvel/rust-amqp","description":"AMQ Protocol implementation in pure rust. Corresponds to rabbitmq spec.","fork":true,"url":"https://api.github.com/repos/divarvel/rust-amqp","forks_url":"https://api.github.com/repos/divarvel/rust-amqp/forks","keys_url":"https://api.github.com/repos/divarvel/rust-amqp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/divarvel/rust-amqp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/divarvel/rust-amqp/teams","hooks_url":"https://api.github.com/repos/divarvel/rust-amqp/hooks","issue_events_url":"https://api.github.com/repos/divarvel/rust-amqp/issues/events{/number}","events_url":"https://api.github.com/repos/divarvel/rust-amqp/events","assignees_url":"https://api.github.com/repos/divarvel/rust-amqp/assignees{/user}","branches_url":"https://api.github.com/repos/divarvel/rust-amqp/branches{/branch}","tags_url":"https://api.github.com/repos/divarvel/rust-amqp/tags","blobs_url":"https://api.github.com/repos/divarvel/rust-amqp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/divarvel/rust-amqp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/divarvel/rust-amqp/git/refs{/sha}","trees_url":"https://api.github.com/repos/divarvel/rust-amqp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/divarvel/rust-amqp/statuses/{sha}","languages_url":"https://api.github.com/repos/divarvel/rust-amqp/languages","stargazers_url":"https://api.github.com/repos/divarvel/rust-amqp/stargazers","contributors_url":"https://api.github.com/repos/divarvel/rust-amqp/contributors","subscribers_url":"https://api.github.com/repos/divarvel/rust-amqp/subscribers","subscription_url":"https://api.github.com/repos/divarvel/rust-amqp/subscription","commits_url":"https://api.github.com/repos/divarvel/rust-amqp/commits{/sha}","git_commits_url":"https://api.github.com/repos/divarvel/rust-amqp/git/commits{/sha}","comments_url":"https://api.github.com/repos/divarvel/rust-amqp/comments{/number}","issue_comment_url":"https://api.github.com/repos/divarvel/rust-amqp/issues/comments{/number}","contents_url":"https://api.github.com/repos/divarvel/rust-amqp/contents/{+path}","compare_url":"https://api.github.com/repos/divarvel/rust-amqp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/divarvel/rust-amqp/merges","archive_url":"https://api.github.com/repos/divarvel/rust-amqp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/divarvel/rust-amqp/downloads","issues_url":"https://api.github.com/repos/divarvel/rust-amqp/issues{/number}","pulls_url":"https://api.github.com/repos/divarvel/rust-amqp/pulls{/number}","milestones_url":"https://api.github.com/repos/divarvel/rust-amqp/milestones{/number}","notifications_url":"https://api.github.com/repos/divarvel/rust-amqp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/divarvel/rust-amqp/labels{/name}","releases_url":"https://api.github.com/repos/divarvel/rust-amqp/releases{/id}","created_at":"2015-07-30T15:06:17Z","updated_at":"2015-07-30T15:06:17Z","pushed_at":"2015-07-30T15:07:42Z","git_url":"git://github.com/divarvel/rust-amqp.git","ssh_url":"git@github.com:divarvel/rust-amqp.git","clone_url":"https://github.com/divarvel/rust-amqp.git","svn_url":"https://github.com/divarvel/rust-amqp","homepage":null,"size":639,"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":"Antti:master","ref":"master","sha":"40d1ac4d91c55fcbb01c7807e0b326b621ea0ccd","user":{"login":"Antti","id":29559,"avatar_url":"https://avatars.githubusercontent.com/u/29559?v=3","gravatar_id":"","url":"https://api.github.com/users/Antti","html_url":"https://github.com/Antti","followers_url":"https://api.github.com/users/Antti/followers","following_url":"https://api.github.com/users/Antti/following{/other_user}","gists_url":"https://api.github.com/users/Antti/gists{/gist_id}","starred_url":"https://api.github.com/users/Antti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antti/subscriptions","organizations_url":"https://api.github.com/users/Antti/orgs","repos_url":"https://api.github.com/users/Antti/repos","events_url":"https://api.github.com/users/Antti/events{/privacy}","received_events_url":"https://api.github.com/users/Antti/received_events","type":"User","site_admin":false},"repo":{"id":23000582,"name":"rust-amqp","full_name":"Antti/rust-amqp","owner":{"login":"Antti","id":29559,"avatar_url":"https://avatars.githubusercontent.com/u/29559?v=3","gravatar_id":"","url":"https://api.github.com/users/Antti","html_url":"https://github.com/Antti","followers_url":"https://api.github.com/users/Antti/followers","following_url":"https://api.github.com/users/Antti/following{/other_user}","gists_url":"https://api.github.com/users/Antti/gists{/gist_id}","starred_url":"https://api.github.com/users/Antti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antti/subscriptions","organizations_url":"https://api.github.com/users/Antti/orgs","repos_url":"https://api.github.com/users/Antti/repos","events_url":"https://api.github.com/users/Antti/events{/privacy}","received_events_url":"https://api.github.com/users/Antti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Antti/rust-amqp","description":"AMQ Protocol implementation in pure rust. Corresponds to rabbitmq spec.","fork":false,"url":"https://api.github.com/repos/Antti/rust-amqp","forks_url":"https://api.github.com/repos/Antti/rust-amqp/forks","keys_url":"https://api.github.com/repos/Antti/rust-amqp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Antti/rust-amqp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Antti/rust-amqp/teams","hooks_url":"https://api.github.com/repos/Antti/rust-amqp/hooks","issue_events_url":"https://api.github.com/repos/Antti/rust-amqp/issues/events{/number}","events_url":"https://api.github.com/repos/Antti/rust-amqp/events","assignees_url":"https://api.github.com/repos/Antti/rust-amqp/assignees{/user}","branches_url":"https://api.github.com/repos/Antti/rust-amqp/branches{/branch}","tags_url":"https://api.github.com/repos/Antti/rust-amqp/tags","blobs_url":"https://api.github.com/repos/Antti/rust-amqp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Antti/rust-amqp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Antti/rust-amqp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Antti/rust-amqp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Antti/rust-amqp/statuses/{sha}","languages_url":"https://api.github.com/repos/Antti/rust-amqp/languages","stargazers_url":"https://api.github.com/repos/Antti/rust-amqp/stargazers","contributors_url":"https://api.github.com/repos/Antti/rust-amqp/contributors","subscribers_url":"https://api.github.com/repos/Antti/rust-amqp/subscribers","subscription_url":"https://api.github.com/repos/Antti/rust-amqp/subscription","commits_url":"https://api.github.com/repos/Antti/rust-amqp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Antti/rust-amqp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Antti/rust-amqp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Antti/rust-amqp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Antti/rust-amqp/contents/{+path}","compare_url":"https://api.github.com/repos/Antti/rust-amqp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Antti/rust-amqp/merges","archive_url":"https://api.github.com/repos/Antti/rust-amqp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Antti/rust-amqp/downloads","issues_url":"https://api.github.com/repos/Antti/rust-amqp/issues{/number}","pulls_url":"https://api.github.com/repos/Antti/rust-amqp/pulls{/number}","milestones_url":"https://api.github.com/repos/Antti/rust-amqp/milestones{/number}","notifications_url":"https://api.github.com/repos/Antti/rust-amqp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Antti/rust-amqp/labels{/name}","releases_url":"https://api.github.com/repos/Antti/rust-amqp/releases{/id}","created_at":"2014-08-15T19:30:02Z","updated_at":"2015-07-30T18:02:33Z","pushed_at":"2015-07-30T17:07:01Z","git_url":"git://github.com/Antti/rust-amqp.git","ssh_url":"git@github.com:Antti/rust-amqp.git","clone_url":"https://github.com/Antti/rust-amqp.git","svn_url":"https://github.com/Antti/rust-amqp","homepage":null,"size":639,"stargazers_count":34,"watchers_count":34,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":3,"forks":8,"open_issues":3,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Antti/rust-amqp/pulls/6"},"html":{"href":"https://github.com/Antti/rust-amqp/pull/6"},"issue":{"href":"https://api.github.com/repos/Antti/rust-amqp/issues/6"},"comments":{"href":"https://api.github.com/repos/Antti/rust-amqp/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/Antti/rust-amqp/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/Antti/rust-amqp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Antti/rust-amqp/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/Antti/rust-amqp/statuses/3336a86de13d3270f2504fe2e4ed353a088e232c"}}}}