Find with(x) { ... } used as an expression

Proprietary

with(x) { … } returns the lambda result, which makes it interchangeable with x.run { … }. The extension form chains better in safe-call sequences (x?.run { … }) and reads as receiver-style throughout.

org.openrewrite.kotlin.idiom.FindWithAsReceiver$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.idiom.FindWithAsReceiver$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.