use

inline fun <T, R> T.use(block: (T) -> R, close: T.() -> Unit): R(source)

Deprecated

See https://kotlinlang.org/docs/whatsnew20.html#stable-autocloseable-interface

Copied and adapted from kotlin.use.