Skip to content

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
andreise committed Dec 24, 2024
1 parent aa37917 commit b74cb35
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public static Optional<TValue> GetValueOrAbsent<TKey, TValue>(
pairs ?? throw new ArgumentNullException(nameof(pairs)),
key);

private const string NotIntendedMessage_TryGetValueOrAbsent
=
"This method is not intended for use. Call GetValueOrAbsent instead.";

[Obsolete(NotIntendedMessage_TryGetValueOrAbsent, error: true)]
[DoesNotReturn]
public static Optional<TValue> TryGetValueOrAbsent<TKey, TValue>(
this IEnumerable<KeyValuePair<TKey, TValue>> pairs,
TKey key)
=>
throw new NotImplementedException(NotIntendedMessage_TryGetValueOrAbsent);

private const string NotIntendedMessage_TryGetValueOrAbsent
=
$"This method is not intended for use. Call {nameof(GetValueOrAbsent)} instead.";
}

0 comments on commit b74cb35

Please sign in to comment.