Skip to content

Commit

Permalink
Fix example in documentation (#2790)
Browse files Browse the repository at this point in the history
ensure(path.isEmpty()) { EmptyPath }
should be
ensure(path.isNotEmpty()) { EmptyPath }

Co-authored-by: Simon Vergauwen <nomisRev@users.noreply.github.com>
  • Loading branch information
obecker and nomisRev authored Aug 7, 2022
1 parent 2da6142 commit 2c37ca1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import kotlin.coroutines.resumeWithException
* ```kotlin
* fun readFile2(path: String?): Effect<EmptyPath, Unit> = effect {
* ensureNotNull(path) { EmptyPath }
* ensure(path.isEmpty()) { EmptyPath }
* ensure(path.isNotEmpty()) { EmptyPath }
* }
* ```
* <!--- KNIT example-effect-guide-01.kt -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ fun readFile(path: String): Effect<EmptyPath, Unit> = effect {

fun readFile2(path: String?): Effect<EmptyPath, Unit> = effect {
ensureNotNull(path) { EmptyPath }
ensure(path.isEmpty()) { EmptyPath }
ensure(path.isNotEmpty()) { EmptyPath }
}

0 comments on commit 2c37ca1

Please sign in to comment.