Skip to content

Instantly share code, notes, and snippets.

@rylev
Created August 27, 2014 10:15
Show Gist options
  • Save rylev/b40ecce85750bd528c0d to your computer and use it in GitHub Desktop.
Save rylev/b40ecce85750bd528c0d to your computer and use it in GitHub Desktop.
Scala If-Bock Styles
if (resp.isSuccess)
Future{ NoContent }
else passthrough(resp)
if (resp.isSuccess) {
Future{ NoContent }
} else {
passthrough(resp)
}
@torsten
Copy link

torsten commented Aug 27, 2014

What about this?

if (resp.isSuccess) Future{ NoContent }
else passthrough(resp)

At least that would feel symmetric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment