{"action":"created","issue":{"url":"https://api.github.com/repos/nrc/rustfmt/issues/504","labels_url":"https://api.github.com/repos/nrc/rustfmt/issues/504/labels{/name}","comments_url":"https://api.github.com/repos/nrc/rustfmt/issues/504/comments","events_url":"https://api.github.com/repos/nrc/rustfmt/issues/504/events","html_url":"https://github.com/nrc/rustfmt/issues/504","id":112314419,"number":504,"title":"trailing comma after blocks in match arms","user":{"login":"oli-obk","id":332036,"avatar_url":"https://avatars.githubusercontent.com/u/332036?v=3","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-20T08:35:41Z","updated_at":"2015-10-20T22:46:18Z","closed_at":null,"body":"match arms that are a block expression don't need commas after them. The style guide isn't clear on this. I add commas after every arm, rustfmt removes them. I'm not sure how to proceed here. Is this a situation of \"leave commas that are there, but don't add them\" or \"fix it to always add\" or keep the current \"always remove\"?\r\n\r\nIf I get some feedback on this I'll post an RFC to fix the styleguide.\r\n\r\nMy preference is to always add the comma, since the code becomes more readable. This way you can always distinguish between a closing block and a match arm that is a block. With the gigantic matches that exist in rustc I've felt this to be an issue many times."},"comment":{"url":"https://api.github.com/repos/nrc/rustfmt/issues/comments/149723899","html_url":"https://github.com/nrc/rustfmt/issues/504#issuecomment-149723899","issue_url":"https://api.github.com/repos/nrc/rustfmt/issues/504","id":149723899,"user":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T22:46:18Z","updated_at":"2015-10-20T22:46:18Z","body":"The style we follow in the compiler and which is adopted in rustfmt is to never have unnecessary commas after blocks. We could certainly add an option to add commas after blocks in match arms if you want it, but I don't think we'll change the default.\r\n\r\nIf you want to make a PR for rustfmt, it would be very simple to do - I'm happy to help out if you'd like."}}