diff --git a/build.gradle.kts b/build.gradle.kts index 581f846..cc60afa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ buildscript { } group = "ru.landgrafhomyak.utility" -version = "1.1" +version = "1.2" repositories { mavenCentral() diff --git a/src/commonMain/kotlin/ru/landgrafhomyak/utility/closeable_state_1/HandleWrapper.kt b/src/commonMain/kotlin/ru/landgrafhomyak/utility/closeable_state_1/HandleWrapper.kt index 0af47b3..7d274fe 100644 --- a/src/commonMain/kotlin/ru/landgrafhomyak/utility/closeable_state_1/HandleWrapper.kt +++ b/src/commonMain/kotlin/ru/landgrafhomyak/utility/closeable_state_1/HandleWrapper.kt @@ -4,24 +4,22 @@ import kotlin.contracts.InvocationKind import kotlin.contracts.contract public class HandleWrapper( - handle: H, - state: CloseableState, + public val handle: H, + public val state: CloseableState, ) { - private val _unprotected = handle - private val _state: CloseableState = state public fun useHandle(method: (H) -> R): R { contract { callsInPlace(method, InvocationKind.EXACTLY_ONCE) } - return this._state.withUse { method(this._unprotected) } + return this.state.withUse { method(this.handle) } } @ManualStateManipulation - private fun close() { - this._state.close() + public fun close() { + this.state.close() } - override fun toString(): String = "" + override fun toString(): String = "" } \ No newline at end of file