@@ -22,7 +22,7 @@ public static bool HasAttributes(this INode node)
22
22
/// Try to get an attribute with the <paramref name="attributeName"/> from the <paramref name="node"/>.
23
23
/// Returns true if the attribute exists, false otherwise.
24
24
/// </summary>
25
- public static bool TryGetAttr ( this INode node , string attributeName , [ NotNullWhen ( true ) ] out IAttr ? attribute )
25
+ public static bool TryGetAttr ( this INode node , string attributeName , [ NotNullWhen ( true ) ] out IAttr ? attribute )
26
26
{
27
27
if ( node is IElement element && element . HasAttribute ( attributeName ) )
28
28
{
@@ -52,7 +52,7 @@ public static bool TryGetAttrValue(this INode node, string attributeName, out bo
52
52
/// Try to get an attribute value off of an element.
53
53
/// Returns true when the attribute was found, false otherwise.
54
54
/// </summary>
55
- public static bool TryGetAttrValue ( this INode node , string attributeName , [ NotNullWhen ( true ) ] out string result )
55
+ public static bool TryGetAttrValue ( this INode node , string attributeName , [ NotNullWhen ( true ) ] out string result )
56
56
{
57
57
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
58
58
result = default ;
@@ -66,21 +66,21 @@ public static bool TryGetAttrValue(this INode node, string attributeName, [NotNu
66
66
/// </summary>
67
67
public static bool TryGetAttrValue < T > ( this INode node , string attributeName , out T result ) where T : System . Enum
68
68
{
69
- #pragma warning disable CS8653 // A default expression introduces a null value for a type parameter .
69
+ #pragma warning disable CS8601 // Possible null reference assignment .
70
70
result = default ;
71
- #pragma warning restore CS8653 // A default expression introduces a null value for a type parameter .
71
+ #pragma warning restore CS8601 // Possible null reference assignment .
72
72
return node is IElement element && element . TryGetAttrValue ( attributeName , out result ) ;
73
73
}
74
74
75
75
/// <summary>
76
76
/// Try to get an attribute value off of an element.
77
77
/// Returns true when the attribute was found, false otherwise.
78
78
/// </summary>
79
- public static bool TryGetAttrValue < T > ( this INode node , string attributeName , Func < string , T > resultFunc , [ NotNullWhen ( true ) ] out T result )
79
+ public static bool TryGetAttrValue < T > ( this INode node , string attributeName , Func < string , T > resultFunc , [ NotNullWhen ( true ) ] out T result ) where T : notnull
80
80
{
81
- #pragma warning disable CS8653 // A default expression introduces a null value for a type parameter .
81
+ #pragma warning disable CS8601 // Possible null reference assignment .
82
82
result = default ;
83
- #pragma warning restore CS8653 // A default expression introduces a null value for a type parameter .
83
+ #pragma warning restore CS8601 // Possible null reference assignment .
84
84
return node is IElement element && element . TryGetAttrValue ( attributeName , resultFunc , out result ) ;
85
85
}
86
86
0 commit comments