public bool Equals()

in src/Elastic.Markdown/Helpers/SemVersion.cs [226:250]


	public bool Equals(SemVersion? other) =>
		other is not null && (
			ReferenceEquals(this, other)
			|| (Major == other.Major && Minor == other.Minor && Patch == other.Patch
				&& Prerelease == other.Prerelease && Metadata == other.Metadata)
		);

	/// <inheritdoc cref="object.Equals(object)"/>
	public override bool Equals(object? obj) => ReferenceEquals(this, obj) || (obj is SemVersion other && Equals(other));

	/// <inheritdoc cref="object.GetHashCode"/>
	public override int GetHashCode() => HashCode.Combine(Major, Minor, Patch, Prerelease, Metadata);

	/// <inheritdoc cref="object.ToString"/>
	public override string ToString()
	{
		var version = $"{Major}.{Minor}.{Patch}";

		if (!string.IsNullOrEmpty(Prerelease))
			version += "-" + Prerelease;
		if (!string.IsNullOrEmpty(Metadata))
			version += "+" + Metadata;

		return version;
	}