Skip to content

Instantly share code, notes, and snippets.

@gkazior
Created April 4, 2016 08:44
Show Gist options
  • Save gkazior/585f6c57ccbfa058badec84992d31ee9 to your computer and use it in GitHub Desktop.
Save gkazior/585f6c57ccbfa058badec84992d31ee9 to your computer and use it in GitHub Desktop.
closeable argument
def using(closeable: {def close(): Unit}, f: => Unit) {
try {
f
} finally {
closeable.close
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment