Address some build warnings

This commit is contained in:
arkon
2020-03-13 18:23:07 -04:00
parent b3daf7d760
commit a0dffcf51f
4 changed files with 7 additions and 7 deletions
@@ -14,6 +14,6 @@ fun launchUI(block: suspend CoroutineScope.() -> Unit): Job =
fun launchIO(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.IO, CoroutineStart.DEFAULT, block)
@UseExperimental(ExperimentalCoroutinesApi::class)
@OptIn(ExperimentalCoroutinesApi::class)
fun launchNow(block: suspend CoroutineScope.() -> Unit): Job =
GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED, block)
@@ -44,7 +44,7 @@ fun String.byteSize(): Int {
* Returns a string containing the first [n] bytes from this string, or the entire string if this
* string is shorter.
*/
@UseExperimental(ExperimentalStdlibApi::class)
@OptIn(ExperimentalStdlibApi::class)
fun String.takeBytes(n: Int): String {
val bytes = toByteArray(Charsets.UTF_8)
return if (bytes.size <= n) {