{"action":"created","issue":{"url":"https://api.github.com/repos/servo/rust-url/issues/81","labels_url":"https://api.github.com/repos/servo/rust-url/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/servo/rust-url/issues/81/comments","events_url":"https://api.github.com/repos/servo/rust-url/issues/81/events","html_url":"https://github.com/servo/rust-url/issues/81","id":58577495,"number":81,"title":"`url::form_urlencoded::serialize` is moving iterated key-value pairs","user":{"login":"Byron","id":63622,"avatar_url":"https://avatars.githubusercontent.com/u/63622?v=3","gravatar_id":"","url":"https://api.github.com/users/Byron","html_url":"https://github.com/Byron","followers_url":"https://api.github.com/users/Byron/followers","following_url":"https://api.github.com/users/Byron/following{/other_user}","gists_url":"https://api.github.com/users/Byron/gists{/gist_id}","starred_url":"https://api.github.com/users/Byron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Byron/subscriptions","organizations_url":"https://api.github.com/users/Byron/orgs","repos_url":"https://api.github.com/users/Byron/repos","events_url":"https://api.github.com/users/Byron/events{/privacy}","received_events_url":"https://api.github.com/users/Byron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-02-23T12:06:25Z","updated_at":"2015-02-24T10:32:49Z","closed_at":null,"body":"Currently [serialize()](http://servo.github.io/rust-url/url/form_urlencoded/fn.serialize.html) is difficult to use for all users who don't want to drain vectors of string slices, but prefer keep iteration strictly read only.\r\nMaybe, in the servo project it's uncommon to do that, but at least I am making my case and believe read-only operation should be the default.\r\n\r\n### Example\r\n```rust\r\nurl::form_urlencoded::serialize([(\"client_id\", \"bogus\"),\r\n                                 (\"scope\", \"A B C\"].iter().map(|&(a,b)| (a, b)));\r\n```\r\nTo my mind, the `.map()` call should not be required.\r\n\r\nMaybe my code is the exception though, and not the rule, but when implementing protocols one will usually have a pre-determined set of key-value pairs. "},"comment":{"url":"https://api.github.com/repos/servo/rust-url/issues/comments/75733170","html_url":"https://github.com/servo/rust-url/issues/81#issuecomment-75733170","issue_url":"https://api.github.com/repos/servo/rust-url/issues/81","id":75733170,"user":{"login":"Byron","id":63622,"avatar_url":"https://avatars.githubusercontent.com/u/63622?v=3","gravatar_id":"","url":"https://api.github.com/users/Byron","html_url":"https://github.com/Byron","followers_url":"https://api.github.com/users/Byron/followers","following_url":"https://api.github.com/users/Byron/following{/other_user}","gists_url":"https://api.github.com/users/Byron/gists{/gist_id}","starred_url":"https://api.github.com/users/Byron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Byron/subscriptions","organizations_url":"https://api.github.com/users/Byron/orgs","repos_url":"https://api.github.com/users/Byron/repos","events_url":"https://api.github.com/users/Byron/events{/privacy}","received_events_url":"https://api.github.com/users/Byron/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T10:32:49Z","updated_at":"2015-02-24T10:32:49Z","body":"Sorry for that.\r\nSo far we agreed that `serialize_owned()` should go away, which leaves `serialze()` to do all the work. My goal still is to find a suitable way to allow it to deal with owned tuples, as well as borrowed ones. So far I believe this might be possible with `std::borrow::Borrowed`, but I didn't cook anything up yet.\r\nAnd no, `Pair` seems like overkill - introducing a new, very general trait just for URLs is nonsensical."}}