fixup! fix: make SemanticVersionRange equality structural
Some checks failed
default / dotnet-default-workflow (push) Failing after 45s

This commit is contained in:
Louis Seubert 2026-07-11 23:08:45 +02:00
commit eb20fb8077
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD

View file

@ -1,8 +1,6 @@
// Copyright (c) The Geekeey Authors // Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2 // SPDX-License-Identifier: EUPL-1.2
using System;
namespace Geekeey.SemVer; namespace Geekeey.SemVer;
/// <summary> /// <summary>
@ -79,7 +77,9 @@ public readonly partial struct SemanticVersionRange : IEquatable<SemanticVersion
/// <inheritdoc /> /// <inheritdoc />
public override bool Equals(object? obj) public override bool Equals(object? obj)
=> obj is SemanticVersionRange other && Equals(other); {
return obj is SemanticVersionRange other && Equals(other);
}
/// <inheritdoc /> /// <inheritdoc />
public override int GetHashCode() public override int GetHashCode()
@ -106,13 +106,17 @@ public readonly partial struct SemanticVersionRange : IEquatable<SemanticVersion
/// Determines whether two semantic version ranges are equal. /// Determines whether two semantic version ranges are equal.
/// </summary> /// </summary>
public static bool operator ==(SemanticVersionRange left, SemanticVersionRange right) public static bool operator ==(SemanticVersionRange left, SemanticVersionRange right)
=> left.Equals(right); {
return left.Equals(right);
}
/// <summary> /// <summary>
/// Determines whether two semantic version ranges differ. /// Determines whether two semantic version ranges differ.
/// </summary> /// </summary>
public static bool operator !=(SemanticVersionRange left, SemanticVersionRange right) public static bool operator !=(SemanticVersionRange left, SemanticVersionRange right)
=> !left.Equals(right); {
return !left.Equals(right);
}
} }
internal enum Comparison { Eq, Neq, Lt, Lte, Gt, Gte } internal enum Comparison { Eq, Neq, Lt, Lte, Gt, Gte }