Merge pull request #8470 from xuwei-k/String-toString

[2.x] refactor: Remove redundant `String#toString`
This commit is contained in:
eugene yokota 2026-01-11 03:17:57 -05:00 committed by GitHub
commit 2b819e24d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View File

@ -179,7 +179,7 @@ private[librarymanagement] abstract class SemComparatorFunctions {
parse(
numbers
.collect { case Some(v) =>
v.toString
v
}
.mkString(".")
)

View File

@ -69,6 +69,6 @@ object IvyCredentials {
private def read(from: File): Map[String, String] = {
val properties = new java.util.Properties
IO.load(properties, from)
properties.asScala.map { (k, v) => (k.toString, v.toString.trim) }.toMap
properties.asScala.map { (k, v) => (k, v.trim) }.toMap
}
}

View File

@ -69,7 +69,7 @@ object CoursierRepositoriesTasks {
val result2 =
paths.ivyHome match {
case Some(ivyHome) =>
val ivyHomeUri = ivyHome.toString
val ivyHomeUri = ivyHome
result1 map {
case r: FileRepository =>
val ivyPatterns = r.patterns.ivyPatterns map {

View File

@ -27,7 +27,7 @@ sealed trait VirtualFileValueCache[A] {
object VirtualFileValueCache {
def definesClassCache(converter: FileConverter): VirtualFileValueCache[DefinesClass] = {
apply(converter) { (x: VirtualFile) =>
if (x.name.toString != "rt.jar") Locate.definesClass(x)
if (x.name != "rt.jar") Locate.definesClass(x)
else (_: String) => false
}
}