File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
tracer/src/Datadog.Trace/Configuration/ConfigurationSources/Telemetry Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change 4
4
// </copyright>
5
5
6
6
#nullable enable
7
- using System . Collections . Generic ;
8
7
9
8
namespace Datadog . Trace . Configuration . ConfigurationSources . Telemetry ;
10
9
11
- internal readonly record struct DefaultResult < T >
10
+ internal readonly struct DefaultResult < T > ( T result , string telemetryValue )
12
11
{
13
- private readonly string ? _telemetryValue ;
14
-
15
- public DefaultResult ( T result , string ? telemetryValue )
16
- {
17
- Result = result ;
18
- _telemetryValue = telemetryValue ;
19
- }
20
-
21
12
/// <summary>
22
13
/// Gets the value to use as the default result
23
14
/// </summary>
24
- public T Result { get ; }
15
+ public T Result { get ; } = result ;
25
16
26
17
/// <summary>
27
18
/// Gets a string representation of the result to use in telemetry.
28
19
/// </summary>
29
- public string ? TelemetryValue => _telemetryValue ?? Result ? . ToString ( ) ;
30
-
31
- public static implicit operator DefaultResult < T > ( T result )
32
- => result is IDictionary < string , string >
33
- ? new ( result , telemetryValue : string . Empty ) // we don't want to call ToString() on these
34
- : new ( result , null ) ;
20
+ public string TelemetryValue { get ; } = telemetryValue ;
35
21
}
You can’t perform that action at this time.
0 commit comments