From 6f26c04f6ca43e55a7e9fa0cb529da93f08abcd2 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sat, 16 Jan 2021 15:06:48 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20StructExtensions=20to?= =?UTF-8?q?=20EnumExtensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- X10D/src/{StructExtensions.cs => EnumExtensions.cs} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename X10D/src/{StructExtensions.cs => EnumExtensions.cs} (90%) diff --git a/X10D/src/StructExtensions.cs b/X10D/src/EnumExtensions.cs similarity index 90% rename from X10D/src/StructExtensions.cs rename to X10D/src/EnumExtensions.cs index 92f5da5..2aff3d9 100644 --- a/X10D/src/StructExtensions.cs +++ b/X10D/src/EnumExtensions.cs @@ -3,9 +3,9 @@ namespace X10D { /// - /// Extension methods for types. + /// Extension methods for types. /// - public static class StructExtensions + public static class EnumExtensions { /// /// Returns the next value in an using the specified value as a starting point. @@ -18,11 +18,11 @@ namespace X10D /// /// Returns a value. public static T Next(this T src, bool wrap = true) - where T : struct + where T : struct, Enum { if (!typeof(T).IsEnum) { - throw new ArgumentException($"Argument {typeof(T).FullName} is not an Enum"); + throw new ArgumentException($"Argument {typeof(T).FullName} is not an enum"); } var arr = (T[])Enum.GetValues(src.GetType()); @@ -41,7 +41,7 @@ namespace X10D /// /// Returns a value. public static T Previous(this T src, bool wrap = true) - where T : struct + where T : struct, Enum { if (!typeof(T).IsEnum) {