Skip to content

Commit 25ddc2c

Browse files
committed
Update JsonFormatter.cs
1 parent 6290235 commit 25ddc2c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Verify/Serialization/JsonFormatter.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ public static StringBuilder AsJson(object? input, List<ToAppend> appends, Verify
99
{
1010
if (appends.Any())
1111
{
12-
var dictionary = new DictionaryWrapper<string, object>();
13-
if (input is null)
12+
var dictionary = new DictionaryWrapper<string, object>
1413
{
15-
dictionary.Add("target", "null");
16-
}
17-
else
18-
{
19-
dictionary.Add("target", input);
20-
}
14+
{"target", input ?? "null"}
15+
};
2116

2217
input = dictionary;
2318
foreach (var append in appends)

0 commit comments

Comments
 (0)