Created
April 4, 2016 08:44
-
-
Save gkazior/585f6c57ccbfa058badec84992d31ee9 to your computer and use it in GitHub Desktop.
closeable argument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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