diff --git a/src/Parsers/TimeSpanParser.cs b/src/Parsers/TimeSpanParser.cs index 4ef8bf2..9588b1c 100644 --- a/src/Parsers/TimeSpanParser.cs +++ b/src/Parsers/TimeSpanParser.cs @@ -33,12 +33,9 @@ public partial class TimeSpanParser : AbstractTypeParser } var matches = ParseRegex().Matches(timeSpanString); - if (matches.Count is 0) - { - return new ArgumentInvalidError(nameof(timeSpanString), "The regex did not produce any matches."); - } - - return ParseFromRegex(matches); + return matches.Count is 0 + ? new ArgumentInvalidError(nameof(timeSpanString), "The regex did not produce any matches.") + : ParseFromRegex(matches); } private static Result ParseFromRegex(MatchCollection matches)