Skip to content

Commit ed3bcc3

Browse files
Apply suggestion from @Copilot
Co-authored-by: Copilot <[email protected]>
1 parent 3ff1732 commit ed3bcc3

File tree

1 file changed

+2
-2
lines changed
  • src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests

1 file changed

+2
-2
lines changed

src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,11 @@ public override void Write(string? value)
889889

890890
if (value.EndsWith("\r\n", StringComparison.Ordinal))
891891
{
892-
WriteLine(value.Substring(0, value.Length - 2));
892+
WriteLine(value[..^2]);
893893
}
894894
else if (value.EndsWith("\n", StringComparison.Ordinal))
895895
{
896-
WriteLine(value.Substring(0, value.Length - 1));
896+
WriteLine(value[..^1]);
897897
}
898898
else
899899
{

0 commit comments

Comments
 (0)