Skip to content

Commit

Permalink
fix: undo the removal of Other as this would mean a breaking API chan…
Browse files Browse the repository at this point in the history
…ge. Instead mark obsolete.

See also 73008ec
  • Loading branch information
skwasjer committed May 20, 2023
1 parent 24167c4 commit 36dff7a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/IbanNet/Registry/Patterns/AsciiCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public enum AsciiCategory
/// </summary>
None = 0,

/// <summary>
/// No ASCII category.
/// </summary>
[Obsolete("Use None instead.", true)]
#pragma warning disable CA1069
// ReSharper disable once UnusedMember.Global
Other = 0,
#pragma warning restore CA1069

/// <summary>
/// The space character.
/// </summary>
Expand Down
5 changes: 3 additions & 2 deletions src/IbanNet/Registry/Patterns/PatternToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ private PatternToken(AsciiCategory category, int minLength, int maxLength, strin
/// <inheritdoc />
public override string ToString()
{
string category = Enum.GetName(typeof(AsciiCategory), Category)!;
return IsFixedLength
? $"{Category}[{MaxLength}]"
: $"{Category}[{MinLength}-{MaxLength}]";
? $"{category}[{MaxLength}]"
: $"{category}[{MinLength}-{MaxLength}]";
}

private static Func<char, int, bool> GetCharacterTest(AsciiCategory category)
Expand Down

0 comments on commit 36dff7a

Please sign in to comment.