diff --git a/src/Kafa/Reader/KafaReader.Col.cs b/src/Kafa/Reader/KafaReader.Col.cs index 290339d..98f4373 100644 --- a/src/Kafa/Reader/KafaReader.Col.cs +++ b/src/Kafa/Reader/KafaReader.Col.cs @@ -1,5 +1,4 @@ -using System.Reflection.PortableExecutable; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; namespace nyingi.Kafa.Reader { @@ -37,7 +36,7 @@ public Col(ColEnumerable colEnumerable, string columnName) [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool TryParse(out T result) where T : ISpanParsable => _colEnumerable.TryParse(Value, out result); + public bool TryParse(out T? result) where T : ISpanParsable => _colEnumerable.TryParse(Value, out result); public override string ToString() { @@ -95,12 +94,12 @@ public ReadOnlySpan ReadColSpan(int index) } - public T Parse(ReadOnlySpan scanSpan) where T : ISpanParsable + public readonly T Parse(ReadOnlySpan scanSpan) where T : ISpanParsable { return T.Parse(scanSpan, _reader.cultureInfo); } - public bool TryParse(ReadOnlySpan colValue, out T result) where T : ISpanParsable + public readonly bool TryParse(ReadOnlySpan colValue, out T? result) where T : ISpanParsable { return T.TryParse(colValue, _reader.cultureInfo, out result); } diff --git a/src/Kafa/Reader/KafaReader.cs b/src/Kafa/Reader/KafaReader.cs index 0cb30b1..465e715 100644 --- a/src/Kafa/Reader/KafaReader.cs +++ b/src/Kafa/Reader/KafaReader.cs @@ -31,7 +31,7 @@ public KafaReader(in KafaReadState kafaReadState) public OrderedDictionary? Headers => _kafaReadState.Headers; [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ReadOnlyMemory ReadRowSpan(int index, out int lastColMarkerIndex) + public readonly ReadOnlyMemory ReadRowSpan(int index, out int lastColMarkerIndex) { lastColMarkerIndex = index + ColumnCount; @@ -51,7 +51,7 @@ public ReadOnlyMemory ReadRowSpan(int index, out int lastColMarkerIndex) } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ReadOnlySpan ReadColSpan(int startIndex, int lastIndex) + public readonly ReadOnlySpan ReadColSpan(int startIndex, int lastIndex) { return _kafaReadState.Buffer.AsSpan(startIndex, lastIndex - startIndex); }