From 12690af14f2af6cd102d5df0bcb6fe73ee9634ef Mon Sep 17 00:00:00 2001 From: andy840119 Date: Mon, 8 Aug 2022 22:16:30 +0800 Subject: [PATCH] Use body expression instead. --- .../LyricImporterStepScreenWithLyricEditor.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/LyricImporterStepScreenWithLyricEditor.cs b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/LyricImporterStepScreenWithLyricEditor.cs index 2a30c3608..3d5f39678 100644 --- a/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/LyricImporterStepScreenWithLyricEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Edit/ImportLyric/LyricImporterStepScreenWithLyricEditor.cs @@ -87,17 +87,12 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl return dependencies; } - public T GetLyricEditorModeState() where T : Enum - { - switch (typeof(T)) + public T GetLyricEditorModeState() where T : Enum => + typeof(T) switch { - case Type t when t == typeof(TextingEditMode): - return EnumUtils.Casting(textingModeState.EditMode); - - default: - throw new NotSupportedException(); - } - } + Type t when t == typeof(TextingEditMode) => EnumUtils.Casting(textingModeState.EditMode), + _ => throw new NotSupportedException() + }; public void SwitchToEditModeState(T mode) where T : Enum {