diff --git a/src/Data/Options/TimeSpanOption.cs b/src/Data/Options/TimeSpanOption.cs index b9b405f..c81a02d 100644 --- a/src/Data/Options/TimeSpanOption.cs +++ b/src/Data/Options/TimeSpanOption.cs @@ -11,12 +11,12 @@ public sealed class TimeSpanOption : Option public override TimeSpan Get(JsonNode settings) { var property = settings[Name]; - return property != null ? ParseTimeSpan(property.GetValue()).Entity : DefaultValue; + return property != null ? TimeSpanParser.TryParse(property.GetValue()).Entity : DefaultValue; } public override Result Set(JsonNode settings, string from) { - if (!ParseTimeSpan(from).IsDefined(out var span)) + if (!TimeSpanParser.TryParse(from).IsDefined(out var span)) { return new ArgumentInvalidError(nameof(from), Messages.InvalidSettingValue); } @@ -24,9 +24,4 @@ public sealed class TimeSpanOption : Option settings[Name] = span.ToString(); return Result.FromSuccess(); } - - private static Result ParseTimeSpan(string from) - { - return TimeSpanParser.TryParse(from); - } }