Find x?.let { } ?: y patterns

Proprietary

x?.let { … } ?: y mixes two intents — transform-when-present and fall-back — into a single expression. Inverts the natural reading order; consider an explicit if (x != null) … else y or pull the elvis branch out for clarity.

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