@@ -14,8 +14,7 @@ namespace System.CommandLine.Subsystems.Annotations;
14
14
/// <typeparam name="TValue">The type of value to be stored</typeparam>
15
15
/// <param name="owner">The subsystem that this annotation store data for.</param>
16
16
/// <param name="id">The identifier for this annotation, since subsystems may have multiple annotations.</param>
17
- /// <param name="defaultValue">The default value to return if the annotation is not set.</param>
18
- public struct AnnotationAccessor < TValue > ( CliSubsystem owner , AnnotationId < TValue > id , TValue ? defaultValue = default )
17
+ public struct AnnotationAccessor < TValue > ( CliSubsystem owner , AnnotationId < TValue > id )
19
18
{
20
19
/// <summary>
21
20
/// The identifier for this annotation, since subsystems may have multiple annotations.
@@ -36,18 +35,4 @@ public struct AnnotationAccessor<TValue>(CliSubsystem owner, AnnotationId<TValue
36
35
/// <param name="value">The value to retrieve.</param>
37
36
/// <returns>True if the value was found, false otherwise.</returns>
38
37
public readonly bool TryGet ( CliSymbol symbol , [ NotNullWhen ( true ) ] out TValue ? value ) => owner . TryGetAnnotation ( symbol , Id , out value ) ;
39
-
40
- /// <summary>
41
- /// Retrieve the value for the annotation and symbol
42
- /// </summary>
43
- /// <param name="symbol">The CliSymbol the value is for.</param>
44
- /// <returns>The retrieved value or <see cref="defaultValue"/> if the value was not found.</returns>
45
- public readonly TValue ? Get ( CliSymbol symbol )
46
- {
47
- if ( TryGet ( symbol , out var value ) )
48
- {
49
- return value ;
50
- }
51
- return defaultValue ;
52
- }
53
38
}
0 commit comments