fixup! fix: make SemanticVersionRange equality structural
Some checks failed
default / dotnet-default-workflow (push) Failing after 45s
Some checks failed
default / dotnet-default-workflow (push) Failing after 45s
This commit is contained in:
parent
fba1476d9c
commit
eb20fb8077
1 changed files with 9 additions and 5 deletions
|
|
@ -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 }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue