Compare commits

...
4 Commits
Author SHA1 Message Date
dependabot[bot] 7091ff7f36 Bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-01-14 12:08:29 -08:00
dependabot[bot] 3377fa0bea Bump actions/setup-dotnet from 4.3.0 to 5.1.0
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4.3.0 to 5.1.0.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/v4.3.0...v5.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: 5.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-01-14 12:07:30 -08:00
ds5678 d759b3db98 Bump version to 3.2.0 in AssetRipper.Primitives.csproj
Updated the package version from 3.1.6 to 3.2.0 to reflect the latest changes and improvements.
2025-04-28 20:42:46 -07:00
ds5678 55b3294ff5 Explicit conversion for Utf8String from ReadOnlySpan 2025-04-28 20:42:03 -07:00
4 changed files with 13 additions and 11 deletions

No files matched your search

+2 -2
View File
@@ -14,9 +14,9 @@ jobs:
dotnet-version: ["9.0", "8.0", "7.0", "6.0"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4.3.0
uses: actions/setup-dotnet@v5.1.0
with:
dotnet-version: |
6.0.x
@@ -33,7 +33,7 @@ public class Utf8StringTests
[Test]
public void Utf8StringMadeFromUtf8LiteralIsTheSameAsMadeFromConstantString()
{
Utf8String dataString = "AssetRipperTestString"u8;
Utf8String dataString = (Utf8String)"AssetRipperTestString"u8;
Utf8String systemString = "AssetRipperTestString";
Assert.That(dataString, Is.EqualTo(systemString));
}
@@ -41,7 +41,7 @@ public class Utf8StringTests
[Test]
public void ConcatenationBetweenTwoUtf8StringsWorks()
{
Utf8String dataString = "AssetRipperTestString"u8;
Utf8String dataString = (Utf8String)"AssetRipperTestString"u8;
Utf8String systemString = "AssetRipperTestString";
Utf8String concatenated = dataString + systemString;
Assert.That(concatenated, Is.EqualTo((Utf8String)"AssetRipperTestStringAssetRipperTestString"u8));
@@ -58,10 +58,10 @@ public class Utf8StringTests
[Test]
public void ConcatenationBetweenFourUtf8StringsWorks()
{
Utf8String string1 = "hello"u8;
Utf8String string2 = " world"u8;
Utf8String string3 = "!"u8;
Utf8String string4 = ", how are you?"u8;
Utf8String string1 = (Utf8String)"hello"u8;
Utf8String string2 = (Utf8String)" world"u8;
Utf8String string3 = (Utf8String)"!"u8;
Utf8String string4 = (Utf8String)", how are you?"u8;
Utf8String concatenated = Utf8String.Concat(string1, string2, string3, string4);
Assert.That(concatenated, Is.EqualTo((Utf8String)"hello world!, how are you?"u8));
}
@@ -81,7 +81,7 @@ public class Utf8StringTests
[Test]
public void IsNullOrEmptyReturnsFalseForNonEmptyString()
{
Assert.That(Utf8String.IsNullOrEmpty("AssetRipperTestString"u8), Is.False);
Assert.That(Utf8String.IsNullOrEmpty((Utf8String)"AssetRipperTestString"u8), Is.False);
}
}
#endif
@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>
<Version>3.1.6</Version>
<Version>3.2.0</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<PackageId>AssetRipper.Primitives</PackageId>
<PackageTags>C# assetripper unity unity3d</PackageTags>
+3 -1
View File
@@ -111,8 +111,10 @@ public sealed class Utf8String :
return utf8String?.String;
}
public static implicit operator Utf8String(ReadOnlySpan<byte> data)
public static explicit operator Utf8String(ReadOnlySpan<byte> data)
{
// Explicit conversion because of first class spans
// https://github.com/dotnet/roslyn/issues/78314
return data.Length == 0 ? Empty : new Utf8String(data);
}