A small comparer adapter used in the editor that implements IComparer<StateRule> by delegating to StateRule.CompareCanonical. It provides a singleton Instance for use in OrderBy and sort calls.
using System.Collections.Generic;
namespace Grains.RazorDesigner.Document;
// Adapter wrapping StateRule.CompareCanonical as an IComparer<StateRule> for OrderBy callsites.
internal sealed class StateRuleCanonicalComparer : IComparer<StateRule>
{
public static readonly StateRuleCanonicalComparer Instance = new();
public int Compare( StateRule a, StateRule b ) => StateRule.CompareCanonical( a, b );
}