From 0b978f5cdfb717c175887a52ba2102018ff0b411 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Wed, 13 Nov 2024 18:22:36 +0000 Subject: [PATCH] refactor!: remove Span.Split --- CHANGELOG.md | 12 ++++++++++-- X10D.Tests/src/Collections/SpanTest.cs | 4 ++++ X10D/src/Collections/SpanExtensions.cs | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29a70fa..521a00e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 4.0.0 - [Unreleased] +## 4.0.1 - [Unreleased] + +### Removed + +- X10D: Removed `Span.Split` for .NET 9.0 target due to conflicts with +[`System.MemoryExtensions.Split`](https://learn.microsoft.com/en-us/dotnet/api/system.memoryextensions.split?view=net-8.0). + +## [4.0.0] - 2024-06-12 ### Added @@ -642,7 +649,8 @@ please [open an issue](https://github.com/oliverbooth/X10D/issues)! Earlier versions of this package are undocumented and unlisted from package results. -[unreleased]: https://github.com/oliverbooth/X10D/compare/v3.3.1...main +[unreleased]: https://github.com/oliverbooth/X10D/compare/v4.0.0...main +[4.0.0]: https://github.com/oliverbooth/X10D/releases/tag/v4.0.0 [3.3.1]: https://github.com/oliverbooth/X10D/releases/tag/v3.3.1 [3.3.0]: https://github.com/oliverbooth/X10D/releases/tag/v3.3.0 [3.2.2]: https://github.com/oliverbooth/X10D/releases/tag/v3.2.2 diff --git a/X10D.Tests/src/Collections/SpanTest.cs b/X10D.Tests/src/Collections/SpanTest.cs index fa7ac45..114336e 100644 --- a/X10D.Tests/src/Collections/SpanTest.cs +++ b/X10D.Tests/src/Collections/SpanTest.cs @@ -1,5 +1,7 @@ using NUnit.Framework; +#if !NET9_0_OR_GREATER using X10D.Collections; +#endif namespace X10D.Tests.Collections; @@ -70,6 +72,7 @@ internal class SpanTest Assert.That(span.ToArray(), Is.EqualTo(new[] {1, 2, 3, 2, 5, 2, 7, 2, 9, 2, 11, 2, 13, 2, 15, 2})); } +#if !NET9_0_OR_GREATER [Test] public void Split_OnEmptySpan_ShouldYieldNothing_UsingCharDelimiter_GivenReadOnlySpan() { @@ -497,4 +500,5 @@ internal class SpanTest Assert.That(index, Is.EqualTo(3)); } +#endif } diff --git a/X10D/src/Collections/SpanExtensions.cs b/X10D/src/Collections/SpanExtensions.cs index 7c3ee0a..d063dd9 100644 --- a/X10D/src/Collections/SpanExtensions.cs +++ b/X10D/src/Collections/SpanExtensions.cs @@ -75,6 +75,7 @@ public static class SpanExtensions } #endif +#if !NET9_0_OR_GREATER /// /// Splits a span of elements into sub-spans based on a delimiting element. /// @@ -134,4 +135,5 @@ public static class SpanExtensions { return new SpanSplitEnumerator(source, delimiter); } +#endif }