Minor, fix warnings on new stdlib API

In modules where allWarningsAsErrors is not yet enabled.
This commit is contained in:
Alexander Udalov
2021-04-09 17:20:07 +02:00
parent e89ab71bf8
commit 168d8b07a8
8 changed files with 14 additions and 14 deletions
@@ -85,7 +85,7 @@ public actual fun CharSequence.regionMatches(thisOffset: Int, other: CharSequenc
@Deprecated("Use replaceFirstChar instead.", ReplaceWith("replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public actual fun String.capitalize(): String {
return if (isNotEmpty()) substring(0, 1).toUpperCase() + substring(1) else this
return if (isNotEmpty()) substring(0, 1).uppercase() + substring(1) else this
}
/**
@@ -97,7 +97,7 @@ public actual fun String.capitalize(): String {
@Deprecated("Use replaceFirstChar instead.", ReplaceWith("replaceFirstChar { it.lowercase() }"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public actual fun String.decapitalize(): String {
return if (isNotEmpty()) substring(0, 1).toLowerCase() + substring(1) else this
return if (isNotEmpty()) substring(0, 1).lowercase() + substring(1) else this
}
/**
@@ -122,7 +122,7 @@ public class SequenceTest {
data.forEach { }
assertEquals(0, count, "onEach should be executed only when resulting sequence is iterated")
val sum = newData.sumBy { it.length }
val sum = newData.sumOf { it.length }
assertEquals(sum, count)
}