Skip to content

Commit 713a08e

Browse files
Introduce vars
1 parent d13d5e5 commit 713a08e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

generators.new/CanonicalData.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
using LibGit2Sharp;
66

7-
using Microsoft.CodeAnalysis.CSharp.Syntax;
8-
97
namespace Generators;
108

119
internal record TestCase(
@@ -23,9 +21,13 @@ internal static class CanonicalData
2321

2422
static CanonicalData() => ProbSpecs.Sync();
2523

26-
internal static TestCase[] Parse(Exercise exercise) =>
27-
Parse(JsonNode.Parse(File.ReadAllText(Paths.CanonicalDataFile(exercise)))!.AsObject(), ImmutableQueue<string>.Empty)
24+
internal static TestCase[] Parse(Exercise exercise)
25+
{
26+
var json = File.ReadAllText(Paths.CanonicalDataFile(exercise));
27+
var jsonNode = JsonNode.Parse(json)!.AsObject();
28+
return Parse(jsonNode, ImmutableQueue<string>.Empty)
2829
.ToArray();
30+
}
2931

3032
private static IEnumerable<TestCase> Parse(JsonObject jsonObject, ImmutableQueue<string> path)
3133
{

0 commit comments

Comments
 (0)