Skip to content

Commit 04d0622

Browse files
Updated reference and cleanup.
1 parent 840998b commit 04d0622

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

IChild.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Diagnostics;
4-
using System.Diagnostics.Contracts;
53

64
namespace Open.Hierarchy
75
{
@@ -22,7 +20,6 @@ public interface IChild<out TParent> : IChild
2220
new TParent? Parent { get; }
2321
}
2422

25-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Null check properly implemented.")]
2623
public static class ChildExtensions
2724
{
2825
/// <summary>

Node.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ public sealed partial class Node<T> : INode<Node<T>>, IElement<T>
2121
IReadOnlyList<object> IParent.Children => EnsureChildrenMapped();
2222
#endregion
2323

24-
#pragma warning disable IDE0044 // Add readonly modifier
2524
private bool _recycled;
26-
#pragma warning restore IDE0044 // Add readonly modifier
25+
2726
void AssertNotRecycled()
2827
{
2928
if (_recycled)

Open.Hierarchy.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<Nullable>enable</Nullable>
7+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
78
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
89
<Authors>electricessence</Authors>
910
<Description>
@@ -40,7 +41,7 @@
4041
</ItemGroup>
4142

4243
<ItemGroup>
43-
<PackageReference Include="Open.Disposable.ObjectPools" Version="2.5.0" />
44+
<PackageReference Include="Open.Disposable.ObjectPools" Version="2.6.0" />
4445
</ItemGroup>
4546

4647
</Project>

TraversalExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static IEnumerable<TNode> GetDescendantsOfType<TNode>(
1919
{
2020
foreach (var descendant in root.GetDescendants(traversal))
2121
{
22-
if (!(descendant is TNode n))
22+
if (descendant is not TNode n)
2323
throw new InvalidCastException(
2424
"Descendant is not of expected generic type and may create inconsistent results. May need to use non-generic node.GetDescenants method.");
2525

0 commit comments

Comments
 (0)