Skip to content

Commit 54a6b40

Browse files
Cleanup.
1 parent 551d6f6 commit 54a6b40

7 files changed

Lines changed: 13 additions & 13 deletions

File tree

Source/Extensions.StringSegment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static StringSegment Last(this string source, string search, StringCompar
8787
public static StringSegment Last(this StringSegment source, in ReadOnlySpan<char> search, StringComparison comparisonType = StringComparison.Ordinal)
8888
{
8989
if (!source.IsValid) throw new ArgumentException("Must be a valid segment.", nameof(source));
90-
Contract.EndContractBlock();
90+
Contract.EndContractBlock();
9191
if (search.IsEmpty)
9292
return default;
9393

Source/Extensions.Trim.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static string TrimStartPattern(this string source,
9898
if (max == 0 || source.Length == 0)
9999
return source;
100100

101-
var i = pattern.RightToLeft ? RightToLeft() : LeftToRight();
101+
var i = pattern.RightToLeft ? RightToLeft() : LeftToRight();
102102
return i == 0 ? source : source.Substring(i);
103103

104104
int RightToLeft()
@@ -192,7 +192,7 @@ public static ReadOnlySpan<char> TrimEndPattern(this ReadOnlySpan<char> source,
192192
Contract.EndContractBlock();
193193

194194
if (max == 0 || source.IsEmpty || pattern.Length == 0 || pattern.Length > source.Length) return source;
195-
195+
196196
return TrimEndPatternCore(source, in pattern, comparisonType, max);
197197
}
198198

Source/Open.Text.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
<EnableNETAnalyzers>true</EnableNETAnalyzers>
88
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
99
<Authors>electricessence</Authors>
10-
<Description>A set of useful classes for working with strings and formatting values.
10+
<Description>
11+
A set of useful extensions for working with strings, spans, and value formatting.
1112

12-
Part of the "Open" set of libraries.
13+
Part of the "Open" set of libraries.
1314
</Description>
1415
<Copyright>© electricessence (Oren F.) All rights reserved.</Copyright>
1516
<PackageProjectUrl>https://github.com/Open-NET-Libraries/Open.Text</PackageProjectUrl>
1617
<RepositoryUrl>https://github.com/Open-NET-Libraries/Open.Text</RepositoryUrl>
1718
<RepositoryType>git</RepositoryType>
18-
<PackageTags>dotnet, dotnetcore, string, text, format, stringbuilder, extensions</PackageTags>
19-
<Version>3.0.0</Version>
19+
<PackageTags>dotnet, dotnetcore, string, span, readonlyspan, text, format, split, trim, first, last, preceding, following, stringbuilder, extensions</PackageTags>
20+
<Version>3.0.1</Version>
2021
<PackageReleaseNotes></PackageReleaseNotes>
2122
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2223
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@@ -39,7 +40,6 @@ Part of the "Open" set of libraries.
3940
</ItemGroup>
4041

4142
<ItemGroup>
42-
<PackageReference Include="Open.MemoryExtensions" Version="2.8.0" />
4343
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
4444
</ItemGroup>
4545

Source/StringSegment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public StringSegment Following(int maxCharacters)
8989
/// </summary>
9090
public bool Equals(StringSegment other)
9191
=> Index == other.Index & Length == other.Length && Source == other.Source;
92-
92+
9393
/// <inheritdoc />
9494
public override bool Equals(object? obj)
9595
=> obj is StringSegment segment && Equals(segment);

Tests/EqualityTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void EqualsSpan(string value, StringComparison comparison = StringCompari
2121
{
2222
var roSpan = value.AsSpan();
2323
var span = roSpan.ToArray().AsSpan();
24-
Assert.True(roSpan.Equals(value,comparison));
24+
Assert.True(roSpan.Equals(value, comparison));
2525
Assert.True(value.Equals(roSpan, comparison));
2626
Assert.True(value.Equals(roSpan.ToArray().AsSpan(), comparison));
2727
Assert.True(span.Equals(value, comparison));

Tests/SplitTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ public static void Split(string sequence, StringSplitOptions options = StringSpl
8282
}
8383

8484
[Theory]
85-
[InlineData("Hello","ll", "He,o")]
85+
[InlineData("Hello", "ll", "He,o")]
8686
[InlineData("HelLo", "Ll", "He,o")]
8787
[InlineData("Hello", "LL", "He,o")]
8888
[InlineData("Hello", "l", "He,o", StringSplitOptions.RemoveEmptyEntries)]
8989
[InlineData("HelLo", "L", "He,o", StringSplitOptions.RemoveEmptyEntries)]
9090
public static void SplitIgnoreCase(string sequence, string split, string expected, StringSplitOptions options = StringSplitOptions.None)
9191
{
9292
var segments = expected.Split(',');
93-
Assert.Equal(segments, sequence.SplitToEnumerable(split, options, StringComparison.OrdinalIgnoreCase));
93+
Assert.Equal(segments, sequence.SplitToEnumerable(split, options, StringComparison.OrdinalIgnoreCase));
9494
Assert.Equal(segments, sequence.SplitAsMemory(split, options, StringComparison.OrdinalIgnoreCase).Select(m => m.Span.ToString()));
9595
var span = sequence.AsSpan();
9696
Assert.Equal(segments, span.Split(split, options, StringComparison.OrdinalIgnoreCase));

Tests/TrimTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static void TrimEndPattern(
9191
public static void TrimStartPatternRegex()
9292
{
9393
Assert.Equal("", "".TrimStartPattern(new Regex("[a-z]")));
94-
Assert.Equal("xyzxyzABCxyz", "xyzxyzABCxyz".TrimStartPattern(new Regex("[a-z]"), 0));
94+
Assert.Equal("xyzxyzABCxyz", "xyzxyzABCxyz".TrimStartPattern(new Regex("[a-z]"), 0));
9595
Assert.Equal("ABCxyz", "xyzxyzABCxyz".TrimStartPattern(new Regex("[a-z]")));
9696
Assert.Equal("ABCxyz", "xyzxyzABCxyz".TrimStartPattern(new Regex("[a-z]+")));
9797
Assert.Equal("ABCxyz", "xyzxyzABCxyz".TrimStartPattern(new Regex("[a-z]", RegexOptions.RightToLeft)));

0 commit comments

Comments
 (0)