diff --git a/SpreadCheetah/SpreadsheetBuffer.cs b/SpreadCheetah/SpreadsheetBuffer.cs index 81e668a4..b7ef0375 100644 --- a/SpreadCheetah/SpreadsheetBuffer.cs +++ b/SpreadCheetah/SpreadsheetBuffer.cs @@ -2,6 +2,7 @@ using SpreadCheetah.Helpers; using System.Buffers.Text; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Runtime.CompilerServices; @@ -67,7 +68,7 @@ public TryWriteInterpolatedStringHandler(int literalLength, int formattedCount, private readonly Span GetSpan() => _buffer._buffer.AsSpan(_buffer._index + _pos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [ExcludeFromCodeCoverage] public bool AppendLiteral(string value) { Debug.Fail("Use ReadOnlySpan instead of string literals"); @@ -92,17 +93,6 @@ public bool AppendFormatted(int value) return Fail(); } - public bool AppendFormatted(uint value) - { - if (Utf8Formatter.TryFormat(value, GetSpan(), out var bytesWritten)) - { - _pos += bytesWritten; - return true; - } - - return Fail(); - } - public bool AppendFormatted(float value) { if (Utf8Formatter.TryFormat(value, GetSpan(), out var bytesWritten)) @@ -125,6 +115,7 @@ public bool AppendFormatted(double value) return Fail(); } + [ExcludeFromCodeCoverage] public bool AppendFormatted(T value) { Debug.Fail("Create non-generic overloads to avoid allocations when running on .NET Framework");