@@ -22,9 +22,7 @@ public static string Print(this SDLPrinter printer, ASTNode node)
2222 /// Prints the specified AST into the specified <see cref="StringBuilder"/> as a SDL document.
2323 /// </summary>
2424 public static void Print ( this SDLPrinter printer , ASTNode node , StringBuilder stringBuilder )
25- #pragma warning disable CA2012 // Use ValueTasks correctly
26- => printer . PrintAsync ( node , new StringWriter ( stringBuilder ) , default ) . GetAwaiter ( ) . GetResult ( ) ;
27- #pragma warning restore CA2012 // Use ValueTasks correctly
25+ => printer . PrintAsync ( node , new StringWriter ( stringBuilder ) , default ) . AsTask ( ) . GetAwaiter ( ) . GetResult ( ) ;
2826
2927 /// <summary>
3028 /// Prints the specified AST into the specified <see cref="MemoryStream"/> as a SDL document.
@@ -33,9 +31,7 @@ public static void Print(this SDLPrinter printer, ASTNode node, StringBuilder st
3331 public static void Print ( this SDLPrinter printer , ASTNode node , MemoryStream memoryStream , Encoding ? encoding = null )
3432 {
3533 using var streamWriter = new StreamWriter ( memoryStream , encoding , - 1 /* default */ , true ) ;
36- #pragma warning disable CA2012 // Use ValueTasks correctly
37- printer . PrintAsync ( node , streamWriter , default ) . GetAwaiter ( ) . GetResult ( ) ;
38- #pragma warning restore CA2012 // Use ValueTasks correctly
34+ printer . PrintAsync ( node , streamWriter , default ) . AsTask ( ) . GetAwaiter ( ) . GetResult ( ) ;
3935 // flush encoder state to stream
4036 streamWriter . Flush ( ) ;
4137 }
0 commit comments