Skip to content

Commit e96ecb3

Browse files
committed
PR suggestions
1 parent c7284d8 commit e96ecb3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/System.CommandLine/Argument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public override IEnumerable<CompletionItem> GetCompletions(CompletionContext con
134134

135135
internal static Argument None { get; } = new NoArgument();
136136

137-
internal class NoArgument : Argument
137+
private sealed class NoArgument : Argument
138138
{
139139
internal NoArgument() : base("@none")
140140
{

src/System.CommandLine/Argument{T}.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ public Func<ArgumentResult, T>? DefaultValueFactory
3434
{
3535
if (_defaultValueFactory is null)
3636
{
37-
switch (this)
37+
if (this is Argument<bool> boolArgument)
3838
{
39-
case Argument<bool> boolArgument:
40-
boolArgument.DefaultValueFactory = _ => false;
41-
break;
39+
boolArgument.DefaultValueFactory = _ => false;
4240
}
4341
}
4442
return _defaultValueFactory;

0 commit comments

Comments
 (0)