mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
rename file with new classcasts
This commit is contained in:
parent
cb4880bd00
commit
bbdff0b31a
@ -58,6 +58,6 @@ dependencies {
|
|||||||
|
|
||||||
ksp {
|
ksp {
|
||||||
arg("cctargetPackage", "dev.inmo.tgbotapi.extensions.utils")
|
arg("cctargetPackage", "dev.inmo.tgbotapi.extensions.utils")
|
||||||
arg("ccoutputFileName", "NewClassCasts")
|
arg("ccoutputFileName", "ClassCastsNew")
|
||||||
arg("ccoutputFolder", project(":tgbotapi.utils").file("src/commonMain/kotlin").absolutePath)
|
arg("ccoutputFolder", project(":tgbotapi.utils").file("src/commonMain/kotlin").absolutePath)
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,36 @@
|
|||||||
|
@file:Suppress("NOTHING_TO_INLINE", "unused", "UNCHECKED_CAST")
|
||||||
|
|
||||||
|
package dev.inmo.tgbotapi.extensions.utils
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.abstracts.FromUser
|
||||||
|
import dev.inmo.tgbotapi.abstracts.WithUser
|
||||||
|
import dev.inmo.tgbotapi.types.abstracts.WithOptionalLanguageCode
|
||||||
|
import dev.inmo.tgbotapi.utils.PreviewFeature
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun <T> Any.ifFromUser(block: (FromUser) -> T) = fromUserOrNull()?.let(block)
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun Any.fromUserOrNull(): FromUser? = this as? FromUser
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun Any.fromUserOrThrow(): FromUser = this as FromUser
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun <T> Any.ifWithUser(block: (WithUser) -> T) = withUserOrNull()?.let(block)
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun Any.withUserOrNull(): WithUser? = this as? WithUser
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun Any.withUserOrThrow(): WithUser = this as WithUser
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun <T> Any.ifWithOptionalLanguageCode(block: (WithOptionalLanguageCode) -> T) =
|
||||||
|
withOptionalLanguageCodeOrNull()?.let(block)
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun Any.withOptionalLanguageCodeOrNull(): WithOptionalLanguageCode? = this as? WithOptionalLanguageCode
|
||||||
|
|
||||||
|
@PreviewFeature
|
||||||
|
inline fun Any.withOptionalLanguageCodeOrThrow(): WithOptionalLanguageCode = this as WithOptionalLanguageCode
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user