{"action":"created","issue":{"url":"https://api.github.com/repos/nrc/rustfmt/issues/485","labels_url":"https://api.github.com/repos/nrc/rustfmt/issues/485/labels{/name}","comments_url":"https://api.github.com/repos/nrc/rustfmt/issues/485/comments","events_url":"https://api.github.com/repos/nrc/rustfmt/issues/485/events","html_url":"https://github.com/nrc/rustfmt/pull/485","id":112027351,"number":485,"title":"Deal with floaters","user":{"login":"marcusklaas","id":1255413,"avatar_url":"https://avatars.githubusercontent.com/u/1255413?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusklaas","html_url":"https://github.com/marcusklaas","followers_url":"https://api.github.com/users/marcusklaas/followers","following_url":"https://api.github.com/users/marcusklaas/following{/other_user}","gists_url":"https://api.github.com/users/marcusklaas/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusklaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusklaas/subscriptions","organizations_url":"https://api.github.com/users/marcusklaas/orgs","repos_url":"https://api.github.com/users/marcusklaas/repos","events_url":"https://api.github.com/users/marcusklaas/events{/privacy}","received_events_url":"https://api.github.com/users/marcusklaas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-18T16:10:28Z","updated_at":"2015-10-18T16:15:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nrc/rustfmt/pulls/485","html_url":"https://github.com/nrc/rustfmt/pull/485","diff_url":"https://github.com/nrc/rustfmt/pull/485.diff","patch_url":"https://github.com/nrc/rustfmt/pull/485.patch"},"body":"One of many possible approaches. I think this one is most in line with the way we format closures; block indentation if it's the last link in the call chain, visual otherwise.\r\n\r\nTypical output with this strategy:\r\n```rust\r\nlet x = match x {\r\n            ...\r\n        }\r\n            .foo()\r\n            .bar();\r\n```\r\n\r\nOther options to consider:\r\n- format with block indent, continue chain on same line as closing brace/ parenthesis of parent\r\n```rust\r\nlet x = match x {\r\n    ...\r\n}.foo()\r\n .bar();\r\n```\r\n- format with block indent, continue on next line with extra indentation\r\n```rust\r\nlet x = match x {\r\n    ...\r\n}\r\n    .foo()\r\n    .bar();\r\n```\r\n- format with visual indentation, continue on next line without extra indentation\r\n```rust\r\nlet x = match x {\r\n            ...\r\n        }\r\n        .foo()\r\n        .bar();\r\n```\r\n- format with block indentation, continue on next line without extra indentation\r\n```rust\r\nlet x = match x {\r\n    ...\r\n}\r\n.foo()\r\n.bar();\r\n```\r\n\r\nAddresses https://github.com/nrc/rustfmt/issues/426."},"comment":{"url":"https://api.github.com/repos/nrc/rustfmt/issues/comments/149027467","html_url":"https://github.com/nrc/rustfmt/pull/485#issuecomment-149027467","issue_url":"https://api.github.com/repos/nrc/rustfmt/issues/485","id":149027467,"user":{"login":"marcusklaas","id":1255413,"avatar_url":"https://avatars.githubusercontent.com/u/1255413?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusklaas","html_url":"https://github.com/marcusklaas","followers_url":"https://api.github.com/users/marcusklaas/followers","following_url":"https://api.github.com/users/marcusklaas/following{/other_user}","gists_url":"https://api.github.com/users/marcusklaas/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusklaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusklaas/subscriptions","organizations_url":"https://api.github.com/users/marcusklaas/orgs","repos_url":"https://api.github.com/users/marcusklaas/repos","events_url":"https://api.github.com/users/marcusklaas/events{/privacy}","received_events_url":"https://api.github.com/users/marcusklaas/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T16:15:26Z","updated_at":"2015-10-18T16:15:26Z","body":"For comparison, we currently produce the following mess:\r\n```rust\r\nlet x = match x {\r\n    ...\r\n}\r\n            .foo()\r\n            .bar();\r\n```"}}