Skip to content

Commit

Permalink
Simplify [DoesNotReturn]
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel Nobel committed May 8, 2023
1 parent c6fc887 commit 49add57
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 20 deletions.
4 changes: 0 additions & 4 deletions src/Qowaiv/Conversion/DateTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ public class DateTypeConverter : DateTypeConverter<Date>
/// <inheritdoc />
[ExcludeFromCodeCoverage]
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
[WillBeSealed]
protected override Date FromDate(Date date) => throw new NotSupportedException();

Expand All @@ -36,9 +34,7 @@ public class DateTypeConverter : DateTypeConverter<Date>
/// <inheritdoc />
[ExcludeFromCodeCoverage]
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
[WillBeSealed]
protected override Date ToDate(Date date) => throw new NotSupportedException();

Expand Down
4 changes: 0 additions & 4 deletions src/Qowaiv/Conversion/LocalDateTimeTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public class LocalDateTimeTypeConverter : DateTypeConverter<LocalDateTime>
/// <inheritdoc />
[ExcludeFromCodeCoverage]
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
[WillBeSealed]
protected override LocalDateTime FromLocalDateTime(LocalDateTime local) => throw new NotSupportedException();

Expand All @@ -45,9 +43,7 @@ protected override DateTimeOffset ToDateTimeOffset(LocalDateTime date)
/// <inheritdoc />
[ExcludeFromCodeCoverage]
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
[WillBeSealed]
protected override LocalDateTime ToLocalDateTime(LocalDateTime date) => throw new NotSupportedException();

Expand Down
4 changes: 0 additions & 4 deletions src/Qowaiv/Conversion/WeekDateTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ public class WeekDateTypeConverter : DateTypeConverter<WeekDate>
/// <inheritdoc />
[ExcludeFromCodeCoverage]
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
[WillBeSealed]
protected override WeekDate FromWeekDate(WeekDate weekDate) => throw new NotSupportedException();

Expand All @@ -52,9 +50,7 @@ public class WeekDateTypeConverter : DateTypeConverter<WeekDate>
/// <inheritdoc />
[ExcludeFromCodeCoverage]
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
[WillBeSealed]
protected override WeekDate ToWeekDate(WeekDate date) => throw new NotSupportedException();
}
4 changes: 0 additions & 4 deletions src/Qowaiv/Hashing/Hash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
/// <summary>Throws a <see cref="HashingNotSupported" />.</summary>
[Pure]
[EditorBrowsable(EditorBrowsableState.Never)]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
[WillBeSealed]
public override int GetHashCode() => NotSupportedBy<Hash>();

Expand Down Expand Up @@ -62,9 +60,7 @@ public static Hash Code<T>(T item)

/// <summary>Indicates that hashing is not supported by the type.</summary>
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
public static int NotSupportedBy<T>()
=> throw new HashingNotSupported(string.Format(QowaivMessages.HashingNotSupported, typeof(T)));

Expand Down
2 changes: 0 additions & 2 deletions src/Qowaiv/Security/Cryptography/CryptographicSeed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ public byte[] ToByteArray()

/// <inheritdoc />
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
public override int GetHashCode() => Hash.NotSupportedBy<CryptographicSeed>();

/// <summary>Represents the cryptographic seed as "*****".</summary>
Expand Down
2 changes: 0 additions & 2 deletions src/Qowaiv/Security/Secret.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ public CryptographicSeed ComputeHash(HashAlgorithm algorithm)

/// <inheritdoc />
[Pure]
#if NET5_0_OR_GREATER
[DoesNotReturn]
#endif
public override int GetHashCode() => Hash.NotSupportedBy<Secret>();

/// <summary>Represents the secret as "*****".</summary>
Expand Down

0 comments on commit 49add57

Please sign in to comment.