Fix NET14 Spans defaulting to ReadOnlySpan

This commit is contained in:
MidoriKami 2025-11-30 12:48:49 -08:00
parent c9276b1771
commit d47a41b295
4 changed files with 11 additions and 11 deletions

View file

@ -156,7 +156,7 @@ public ref struct ImU8String
return this.rentedBuffer is { } buf
? buf.AsSpan()
: MemoryMarshal.Cast<FixedBufferContainer, byte>(new(ref Unsafe.AsRef(ref this.fixedBuffer)));
: MemoryMarshal.Cast<FixedBufferContainer, byte>(new Span<FixedBufferContainer>(ref Unsafe.AsRef(ref this.fixedBuffer)));
}
}
@ -165,7 +165,7 @@ public ref struct ImU8String
private ref byte FixedBufferByteRef => ref this.FixedBufferSpan[0];
private Span<byte> FixedBufferSpan =>
MemoryMarshal.Cast<FixedBufferContainer, byte>(new(ref Unsafe.AsRef(ref this.fixedBuffer)));
MemoryMarshal.Cast<FixedBufferContainer, byte>(new Span<FixedBufferContainer>(ref Unsafe.AsRef(ref this.fixedBuffer)));
public static implicit operator ImU8String(ReadOnlySpan<byte> text) => new(text);
public static implicit operator ImU8String(ReadOnlyMemory<byte> text) => new(text);