Find map { it.toString() } / map { x -> x.toString() } patterns

Proprietary

If the producer already returns a type whose toString() is the desired representation, the map is a no-op. If the goal is to materialize the Strings up-front, joinToString() / toString() on the collection is usually a better fit.

org.openrewrite.kotlin.bestpractices.FindRedundantToStringInMap$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.bestpractices.FindRedundantToStringInMap$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.