diff --git a/MiraAPI/Roles/CustomRoleSingleton.cs b/MiraAPI/Roles/CustomRoleSingleton.cs index 808202c..90867af 100644 --- a/MiraAPI/Roles/CustomRoleSingleton.cs +++ b/MiraAPI/Roles/CustomRoleSingleton.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System.Diagnostics.CodeAnalysis; +using System.Linq; namespace MiraAPI.Roles; @@ -8,12 +9,11 @@ namespace MiraAPI.Roles; /// The role you are trying to access. public static class CustomRoleSingleton where T : ICustomRole { - private static ICustomRole? _instance; + private static T? _instance; /// /// Gets the instance of the role. /// -#pragma warning disable CA1000 - public static ICustomRole Instance => _instance ??= CustomRoleManager.CustomRoles.Values.OfType().Single(); -#pragma warning restore CA1000 + [SuppressMessage("Design", "CA1000:Do not declare static members on generic types", Justification = "This is a utility class to get the instance of a custom role.")] + public static T Instance => _instance ??= CustomRoleManager.CustomRoles.Values.OfType().Single(); }