Skip to content

Commit

Permalink
Use body expression instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Aug 8, 2022
1 parent e049d0c commit 12690af
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,12 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
return dependencies;
}

public T GetLyricEditorModeState<T>() where T : Enum
{
switch (typeof(T))
public T GetLyricEditorModeState<T>() where T : Enum =>
typeof(T) switch
{
case Type t when t == typeof(TextingEditMode):
return EnumUtils.Casting<T>(textingModeState.EditMode);

default:
throw new NotSupportedException();
}
}
Type t when t == typeof(TextingEditMode) => EnumUtils.Casting<T>(textingModeState.EditMode),
_ => throw new NotSupportedException()
};

public void SwitchToEditModeState<T>(T mode) where T : Enum
{
Expand Down

0 comments on commit 12690af

Please sign in to comment.