Use Cast<T>() instead of Select with cast

Proprietary

Replace .Select(x => (T)x) with .Cast<T>(). The Cast<T>() method is more concise and clearly expresses the intent.

OpenRewrite.Recipes.CSharp.CodeQuality.Linq.UseCastInsteadOfSelect
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Linq.UseCastInsteadOfSelect

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