diff --git a/src/IDisposableGenerator/WorkItemCollection.cs b/src/IDisposableGenerator/WorkItemCollection.cs index 4402a81..bb94ee9 100644 --- a/src/IDisposableGenerator/WorkItemCollection.cs +++ b/src/IDisposableGenerator/WorkItemCollection.cs @@ -56,6 +56,7 @@ public int IndexOf(WorkItem item) foreach (var attr in testClass.GetAttributes()) { +#pragma warning disable IDE0010 // Add missing cases switch (attr.AttributeClass!.Name) { case "GenerateDisposeAttribute": @@ -67,12 +68,11 @@ public int IndexOf(WorkItem item) case "GenerateThrowIfDisposedAttribute": result.ThrowIfDisposed = true; break; - default: - break; } +#pragma warning restore IDE0010 // Add missing cases } - return !hasDisposalGeneration ? null : result; + return hasDisposalGeneration ? result : null; } private static void CheckAttributesOnMember(ISymbol member,