{"action":"created","comment":{"url":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/comments/135671274","pull_request_review_id":59106879,"id":135671274,"diff_hunk":"@@ -46,18 +48,145 @@ where\n         key: &K,\n         value: &V,\n     ) -> Result<()> {\n-        // TODO: Is it possible to ensure our key is never a composite type?\n-        // Anything which isn't a \"primitive\" would lead to malformed XML here...\n-        write!(self.parent.writer, \"<\")?;\n-        key.serialize(&mut *self.parent)?;\n-        write!(self.parent.writer, \">\")?;\n+        let key = key.serialize(&mut MapKeySerializer)?;","path":"src/ser/var.rs","position":23,"original_position":23,"commit_id":"c9010e28d5059f88845c0ebd07d9666e2a4d152a","original_commit_id":"c9010e28d5059f88845c0ebd07d9666e2a4d152a","user":{"login":"Michael-F-Bryan","id":17380079,"avatar_url":"https://avatars2.githubusercontent.com/u/17380079?v=4","gravatar_id":"","url":"https://api.github.com/users/Michael-F-Bryan","html_url":"https://github.com/Michael-F-Bryan","followers_url":"https://api.github.com/users/Michael-F-Bryan/followers","following_url":"https://api.github.com/users/Michael-F-Bryan/following{/other_user}","gists_url":"https://api.github.com/users/Michael-F-Bryan/gists{/gist_id}","starred_url":"https://api.github.com/users/Michael-F-Bryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Michael-F-Bryan/subscriptions","organizations_url":"https://api.github.com/users/Michael-F-Bryan/orgs","repos_url":"https://api.github.com/users/Michael-F-Bryan/repos","events_url":"https://api.github.com/users/Michael-F-Bryan/events{/privacy}","received_events_url":"https://api.github.com/users/Michael-F-Bryan/received_events","type":"User","site_admin":false},"body":"I made a very similar thing in #36 to detect whether something would be \"wrapped\" when serialized and [mentioned] we can use it to resolve this todo. I think it's a bit more general than your `MapKeySerializer`, so when #36 lands should we try to adapt this bit of code to use that? \r\n\r\nTo make `WrapSafeDetector` more useful, it could probably return an enum which represents roughly which type of thing something  is (e.g. `Kind::String`, `Kind::Complex`, `Kind::Numeric`) with `is_wrapped()` being a helper method.\r\n\r\n[mentioned]: https://github.com/RReverser/serde-xml-rs/pull/36#issuecomment-324070360","created_at":"2017-08-29T00:54:45Z","updated_at":"2017-08-29T01:00:39Z","html_url":"https://github.com/RReverser/serde-xml-rs/pull/40#discussion_r135671274","pull_request_url":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/comments/135671274"},"html":{"href":"https://github.com/RReverser/serde-xml-rs/pull/40#discussion_r135671274"},"pull_request":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/40","id":137457201,"html_url":"https://github.com/RReverser/serde-xml-rs/pull/40","diff_url":"https://github.com/RReverser/serde-xml-rs/pull/40.diff","patch_url":"https://github.com/RReverser/serde-xml-rs/pull/40.patch","issue_url":"https://api.github.com/repos/RReverser/serde-xml-rs/issues/40","number":40,"state":"open","locked":false,"title":"Switch from write to xml-rs","user":{"login":"farodin91","id":1159212,"avatar_url":"https://avatars1.githubusercontent.com/u/1159212?v=4","gravatar_id":"","url":"https://api.github.com/users/farodin91","html_url":"https://github.com/farodin91","followers_url":"https://api.github.com/users/farodin91/followers","following_url":"https://api.github.com/users/farodin91/following{/other_user}","gists_url":"https://api.github.com/users/farodin91/gists{/gist_id}","starred_url":"https://api.github.com/users/farodin91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farodin91/subscriptions","organizations_url":"https://api.github.com/users/farodin91/orgs","repos_url":"https://api.github.com/users/farodin91/repos","events_url":"https://api.github.com/users/farodin91/events{/privacy}","received_events_url":"https://api.github.com/users/farodin91/received_events","type":"User","site_admin":false},"body":"Fixes #39 ","created_at":"2017-08-24T13:42:09Z","updated_at":"2017-08-29T01:00:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0151daff7571cfc02c7dbe6fe041a509a9105807","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/40/commits","review_comments_url":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/40/comments","review_comment_url":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RReverser/serde-xml-rs/issues/40/comments","statuses_url":"https://api.github.com/repos/RReverser/serde-xml-rs/statuses/c9010e28d5059f88845c0ebd07d9666e2a4d152a","head":{"label":"farodin91:refactor","ref":"refactor","sha":"c9010e28d5059f88845c0ebd07d9666e2a4d152a","user":{"login":"farodin91","id":1159212,"avatar_url":"https://avatars1.githubusercontent.com/u/1159212?v=4","gravatar_id":"","url":"https://api.github.com/users/farodin91","html_url":"https://github.com/farodin91","followers_url":"https://api.github.com/users/farodin91/followers","following_url":"https://api.github.com/users/farodin91/following{/other_user}","gists_url":"https://api.github.com/users/farodin91/gists{/gist_id}","starred_url":"https://api.github.com/users/farodin91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farodin91/subscriptions","organizations_url":"https://api.github.com/users/farodin91/orgs","repos_url":"https://api.github.com/users/farodin91/repos","events_url":"https://api.github.com/users/farodin91/events{/privacy}","received_events_url":"https://api.github.com/users/farodin91/received_events","type":"User","site_admin":false},"repo":{"id":89489217,"name":"serde-xml-rs","full_name":"farodin91/serde-xml-rs","owner":{"login":"farodin91","id":1159212,"avatar_url":"https://avatars1.githubusercontent.com/u/1159212?v=4","gravatar_id":"","url":"https://api.github.com/users/farodin91","html_url":"https://github.com/farodin91","followers_url":"https://api.github.com/users/farodin91/followers","following_url":"https://api.github.com/users/farodin91/following{/other_user}","gists_url":"https://api.github.com/users/farodin91/gists{/gist_id}","starred_url":"https://api.github.com/users/farodin91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farodin91/subscriptions","organizations_url":"https://api.github.com/users/farodin91/orgs","repos_url":"https://api.github.com/users/farodin91/repos","events_url":"https://api.github.com/users/farodin91/events{/privacy}","received_events_url":"https://api.github.com/users/farodin91/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/farodin91/serde-xml-rs","description":"xml-rs based deserializer for Serde (compatible with 0.9+)","fork":true,"url":"https://api.github.com/repos/farodin91/serde-xml-rs","forks_url":"https://api.github.com/repos/farodin91/serde-xml-rs/forks","keys_url":"https://api.github.com/repos/farodin91/serde-xml-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/farodin91/serde-xml-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/farodin91/serde-xml-rs/teams","hooks_url":"https://api.github.com/repos/farodin91/serde-xml-rs/hooks","issue_events_url":"https://api.github.com/repos/farodin91/serde-xml-rs/issues/events{/number}","events_url":"https://api.github.com/repos/farodin91/serde-xml-rs/events","assignees_url":"https://api.github.com/repos/farodin91/serde-xml-rs/assignees{/user}","branches_url":"https://api.github.com/repos/farodin91/serde-xml-rs/branches{/branch}","tags_url":"https://api.github.com/repos/farodin91/serde-xml-rs/tags","blobs_url":"https://api.github.com/repos/farodin91/serde-xml-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/farodin91/serde-xml-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/farodin91/serde-xml-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/farodin91/serde-xml-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/farodin91/serde-xml-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/farodin91/serde-xml-rs/languages","stargazers_url":"https://api.github.com/repos/farodin91/serde-xml-rs/stargazers","contributors_url":"https://api.github.com/repos/farodin91/serde-xml-rs/contributors","subscribers_url":"https://api.github.com/repos/farodin91/serde-xml-rs/subscribers","subscription_url":"https://api.github.com/repos/farodin91/serde-xml-rs/subscription","commits_url":"https://api.github.com/repos/farodin91/serde-xml-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/farodin91/serde-xml-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/farodin91/serde-xml-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/farodin91/serde-xml-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/farodin91/serde-xml-rs/contents/{+path}","compare_url":"https://api.github.com/repos/farodin91/serde-xml-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/farodin91/serde-xml-rs/merges","archive_url":"https://api.github.com/repos/farodin91/serde-xml-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/farodin91/serde-xml-rs/downloads","issues_url":"https://api.github.com/repos/farodin91/serde-xml-rs/issues{/number}","pulls_url":"https://api.github.com/repos/farodin91/serde-xml-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/farodin91/serde-xml-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/farodin91/serde-xml-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/farodin91/serde-xml-rs/labels{/name}","releases_url":"https://api.github.com/repos/farodin91/serde-xml-rs/releases{/id}","deployments_url":"https://api.github.com/repos/farodin91/serde-xml-rs/deployments","created_at":"2017-04-26T14:16:40Z","updated_at":"2017-04-26T14:16:42Z","pushed_at":"2017-08-24T13:55:59Z","git_url":"git://github.com/farodin91/serde-xml-rs.git","ssh_url":"git@github.com:farodin91/serde-xml-rs.git","clone_url":"https://github.com/farodin91/serde-xml-rs.git","svn_url":"https://github.com/farodin91/serde-xml-rs","homepage":"https://crates.io/crates/serde-xml-rs","size":68,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"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":"RReverser:master","ref":"master","sha":"d824bca2f193d554bfe58d5de211994c7079bf12","user":{"login":"RReverser","id":557590,"avatar_url":"https://avatars2.githubusercontent.com/u/557590?v=4","gravatar_id":"","url":"https://api.github.com/users/RReverser","html_url":"https://github.com/RReverser","followers_url":"https://api.github.com/users/RReverser/followers","following_url":"https://api.github.com/users/RReverser/following{/other_user}","gists_url":"https://api.github.com/users/RReverser/gists{/gist_id}","starred_url":"https://api.github.com/users/RReverser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RReverser/subscriptions","organizations_url":"https://api.github.com/users/RReverser/orgs","repos_url":"https://api.github.com/users/RReverser/repos","events_url":"https://api.github.com/users/RReverser/events{/privacy}","received_events_url":"https://api.github.com/users/RReverser/received_events","type":"User","site_admin":false},"repo":{"id":82204034,"name":"serde-xml-rs","full_name":"RReverser/serde-xml-rs","owner":{"login":"RReverser","id":557590,"avatar_url":"https://avatars2.githubusercontent.com/u/557590?v=4","gravatar_id":"","url":"https://api.github.com/users/RReverser","html_url":"https://github.com/RReverser","followers_url":"https://api.github.com/users/RReverser/followers","following_url":"https://api.github.com/users/RReverser/following{/other_user}","gists_url":"https://api.github.com/users/RReverser/gists{/gist_id}","starred_url":"https://api.github.com/users/RReverser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RReverser/subscriptions","organizations_url":"https://api.github.com/users/RReverser/orgs","repos_url":"https://api.github.com/users/RReverser/repos","events_url":"https://api.github.com/users/RReverser/events{/privacy}","received_events_url":"https://api.github.com/users/RReverser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RReverser/serde-xml-rs","description":"xml-rs based deserializer for Serde (compatible with 1.0+)","fork":false,"url":"https://api.github.com/repos/RReverser/serde-xml-rs","forks_url":"https://api.github.com/repos/RReverser/serde-xml-rs/forks","keys_url":"https://api.github.com/repos/RReverser/serde-xml-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RReverser/serde-xml-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RReverser/serde-xml-rs/teams","hooks_url":"https://api.github.com/repos/RReverser/serde-xml-rs/hooks","issue_events_url":"https://api.github.com/repos/RReverser/serde-xml-rs/issues/events{/number}","events_url":"https://api.github.com/repos/RReverser/serde-xml-rs/events","assignees_url":"https://api.github.com/repos/RReverser/serde-xml-rs/assignees{/user}","branches_url":"https://api.github.com/repos/RReverser/serde-xml-rs/branches{/branch}","tags_url":"https://api.github.com/repos/RReverser/serde-xml-rs/tags","blobs_url":"https://api.github.com/repos/RReverser/serde-xml-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RReverser/serde-xml-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RReverser/serde-xml-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/RReverser/serde-xml-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RReverser/serde-xml-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/RReverser/serde-xml-rs/languages","stargazers_url":"https://api.github.com/repos/RReverser/serde-xml-rs/stargazers","contributors_url":"https://api.github.com/repos/RReverser/serde-xml-rs/contributors","subscribers_url":"https://api.github.com/repos/RReverser/serde-xml-rs/subscribers","subscription_url":"https://api.github.com/repos/RReverser/serde-xml-rs/subscription","commits_url":"https://api.github.com/repos/RReverser/serde-xml-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/RReverser/serde-xml-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/RReverser/serde-xml-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/RReverser/serde-xml-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/RReverser/serde-xml-rs/contents/{+path}","compare_url":"https://api.github.com/repos/RReverser/serde-xml-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RReverser/serde-xml-rs/merges","archive_url":"https://api.github.com/repos/RReverser/serde-xml-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RReverser/serde-xml-rs/downloads","issues_url":"https://api.github.com/repos/RReverser/serde-xml-rs/issues{/number}","pulls_url":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/RReverser/serde-xml-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/RReverser/serde-xml-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RReverser/serde-xml-rs/labels{/name}","releases_url":"https://api.github.com/repos/RReverser/serde-xml-rs/releases{/id}","deployments_url":"https://api.github.com/repos/RReverser/serde-xml-rs/deployments","created_at":"2017-02-16T16:54:58Z","updated_at":"2017-08-21T13:48:47Z","pushed_at":"2017-08-24T13:56:00Z","git_url":"git://github.com/RReverser/serde-xml-rs.git","ssh_url":"git@github.com:RReverser/serde-xml-rs.git","clone_url":"https://github.com/RReverser/serde-xml-rs.git","svn_url":"https://github.com/RReverser/serde-xml-rs","homepage":"https://crates.io/crates/serde-xml-rs","size":92,"stargazers_count":18,"watchers_count":18,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":14,"forks":7,"open_issues":14,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/40"},"html":{"href":"https://github.com/RReverser/serde-xml-rs/pull/40"},"issue":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/issues/40"},"comments":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/RReverser/serde-xml-rs/statuses/c9010e28d5059f88845c0ebd07d9666e2a4d152a"}}}}
{"actor":{"display_login":"Michael-F-Bryan"}}