From e875047899af00f47eec32d5415ae5f1a607947e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 15 Jun 2023 16:39:24 +0530 Subject: feat: adopt Kotlin 1.9 Enum entries feature --- .../main/kotlin/app/passwordstore/passgen/random/PasswordGenerator.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'passgen/random') diff --git a/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/PasswordGenerator.kt b/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/PasswordGenerator.kt index 4f08904d..faf0ad4c 100644 --- a/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/PasswordGenerator.kt +++ b/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/PasswordGenerator.kt @@ -7,6 +7,7 @@ package app.passwordstore.passgen.random import app.passwordstore.passgen.random.util.clearFlag import app.passwordstore.passgen.random.util.hasFlag +@OptIn(ExperimentalStdlibApi::class) public object PasswordGenerator { public const val DEFAULT_LENGTH: Int = 16 @@ -39,7 +40,7 @@ public object PasswordGenerator { var phonemes = true var pwgenFlags = DIGITS or UPPERS or LOWERS - for (option in PasswordOption.values()) { + for (option in PasswordOption.entries) { if (option in passwordOptions) { when (option) { PasswordOption.NoDigits -> pwgenFlags = pwgenFlags.clearFlag(DIGITS) -- cgit v1.2.3