{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/fmt-rfcs/issues/43","repository_url":"https://api.github.com/repos/rust-lang-nursery/fmt-rfcs","labels_url":"https://api.github.com/repos/rust-lang-nursery/fmt-rfcs/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/fmt-rfcs/issues/43/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/fmt-rfcs/issues/43/events","html_url":"https://github.com/rust-lang-nursery/fmt-rfcs/issues/43","id":192625488,"number":43,"title":"Newline before else","user":{"login":"repax","id":10134307,"avatar_url":"https://avatars.githubusercontent.com/u/10134307?v=3","gravatar_id":"","url":"https://api.github.com/users/repax","html_url":"https://github.com/repax","followers_url":"https://api.github.com/users/repax/followers","following_url":"https://api.github.com/users/repax/following{/other_user}","gists_url":"https://api.github.com/users/repax/gists{/gist_id}","starred_url":"https://api.github.com/users/repax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/repax/subscriptions","organizations_url":"https://api.github.com/users/repax/orgs","repos_url":"https://api.github.com/users/repax/repos","events_url":"https://api.github.com/users/repax/events{/privacy}","received_events_url":"https://api.github.com/users/repax/received_events","type":"User","site_admin":false},"labels":[{"id":370616728,"url":"https://api.github.com/repos/rust-lang-nursery/fmt-rfcs/labels/final-comment-period","name":"final-comment-period","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-11-30T17:15:08Z","updated_at":"2016-12-19T07:03:12Z","closed_at":null,"body":"# Newline before else / else if\r\nShould there be a newline before `else`?\r\n\r\n## Snippet from the list.rs example file\r\n```rust\r\nlet post_snippet_trimmed = if post_snippet.starts_with(',') {\r\n    post_snippet[1..].trim_matches(white_space)\r\n} else if post_snippet.ends_with(',') {\r\n    post_snippet[..(post_snippet.len() - 1)].trim_matches(white_space)\r\n} else {\r\n    post_snippet\r\n};\r\n```\r\nvs:\r\n```rust\r\nlet post_snippet_trimmed = if post_snippet.starts_with(',') {\r\n    post_snippet[1..].trim_matches(white_space)\r\n}\r\nelse if post_snippet.ends_with(',') {\r\n    post_snippet[..(post_snippet.len() - 1)].trim_matches(white_space)\r\n}\r\nelse {\r\n    post_snippet\r\n};\r\n```\r\n## Some specifics from the Guiding principles\r\nI found some guidelines that might be relevant:\r\n> - compatibility with version control practices - preserving diffs, merge-friendliness, etc.\r\n> - preventing right-ward drift\r\n> - minimising vertical space\r\n\r\nWould a newline be [desirable with regards to version control logs](http://rhodesmill.org/brandon/2012/one-sentence-per-line/) when adding / removing `else` blocks? If so, does that outweigh the benefit of minimising vertical space -- a point of lower priority according to the list of guiding principles?\r\n\r\nDoes a newline here, in any way, influence readability or scan-ability? For example, does the vertical space [help perception in grouping](https://en.wikipedia.org/wiki/Principles_of_grouping#Proximity) lines of code that belong together (i.e. the condition and the subsequent block contents)?"},"comment":{"url":"https://api.github.com/repos/rust-lang-nursery/fmt-rfcs/issues/comments/267895643","html_url":"https://github.com/rust-lang-nursery/fmt-rfcs/issues/43#issuecomment-267895643","issue_url":"https://api.github.com/repos/rust-lang-nursery/fmt-rfcs/issues/43","id":267895643,"user":{"login":"KalitaAlexey","id":11215191,"avatar_url":"https://avatars.githubusercontent.com/u/11215191?v=3","gravatar_id":"","url":"https://api.github.com/users/KalitaAlexey","html_url":"https://github.com/KalitaAlexey","followers_url":"https://api.github.com/users/KalitaAlexey/followers","following_url":"https://api.github.com/users/KalitaAlexey/following{/other_user}","gists_url":"https://api.github.com/users/KalitaAlexey/gists{/gist_id}","starred_url":"https://api.github.com/users/KalitaAlexey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KalitaAlexey/subscriptions","organizations_url":"https://api.github.com/users/KalitaAlexey/orgs","repos_url":"https://api.github.com/users/KalitaAlexey/repos","events_url":"https://api.github.com/users/KalitaAlexey/events{/privacy}","received_events_url":"https://api.github.com/users/KalitaAlexey/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T07:03:12Z","updated_at":"2016-12-19T07:03:12Z","body":"@est31, yes thanks."}}
{"actor":{"display_login":"KalitaAlexey"}}