Replace Enum.ToString() with nameof

Proprietary

Replace MyEnum.Value.ToString() with nameof(MyEnum.Value). The nameof operator is evaluated at compile time, avoiding runtime reflection.

OpenRewrite.Recipes.CSharp.CodeQuality.Performance.ReplaceEnumToStringWithNameof
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Performance.ReplaceEnumToStringWithNameof

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