Kotlin 2.0.0 cleanups

This commit is contained in:
Erik C. Thauvin 2024-07-11 19:54:22 -07:00
parent 086c736b9e
commit c3c4ae20ad
Signed by: erik
GPG key ID: 776702A6A2DA330E
2 changed files with 2 additions and 4 deletions

View file

@ -61,7 +61,7 @@ open class Akismet(apiKey: String) {
*/
@JvmStatic
fun jsonComment(json: String): AkismetComment {
return Json.decodeFromString(AkismetComment.serializer(), json)
return Json.decodeFromString<AkismetComment>(json)
}
/**

View file

@ -31,8 +31,6 @@
package net.thauvin.erik.akismet
import net.thauvin.erik.akismet.AkismetComment.Companion.ADMIN_ROLE
/**
* Provides a comment configuration.
*/
@ -169,7 +167,7 @@ class CommentConfig private constructor(builder: Builder) {
/**
* Set the user role of the user who submitted the comment. This is an optional parameter.
*
* If you set it to [ADMIN_ROLE], Akismet will always return `false`.
* If you set it to [AkismetComment.ADMIN_ROLE], Akismet will always return `false`.
*/
fun userRole(userRole: String): Builder = apply { this.userRole = userRole }