From c63fd45e38948327558b41ef40153e49ab6ff864 Mon Sep 17 00:00:00 2001 From: Alex Macocian Date: Tue, 20 May 2025 18:41:39 +0200 Subject: [PATCH] Fix from managed to fixed array --- SystemExtensions.NetStandard.Generators/FixedArrayGenerator.cs | 2 +- .../SystemExtensions.NetStandard.Generators.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SystemExtensions.NetStandard.Generators/FixedArrayGenerator.cs b/SystemExtensions.NetStandard.Generators/FixedArrayGenerator.cs index 89e2cd5..8d1b48e 100644 --- a/SystemExtensions.NetStandard.Generators/FixedArrayGenerator.cs +++ b/SystemExtensions.NetStandard.Generators/FixedArrayGenerator.cs @@ -127,7 +127,7 @@ public class FixedArrayGenerator : IIncrementalGenerator builder.AppendLine(" }"); builder.AppendLine(" }"); builder.AppendLine(); - builder.AppendLine($" public static {structName} FromBytes(byte[] array)"); + builder.AppendLine($" public static {structName} From{capitalizedType}Array({targetType}[] array)"); builder.AppendLine(" {"); builder.AppendLine($" var arr = default({structName});"); builder.AppendLine(" array.AsSpan().CopyTo(arr.AsSpan());"); diff --git a/SystemExtensions.NetStandard.Generators/SystemExtensions.NetStandard.Generators.csproj b/SystemExtensions.NetStandard.Generators/SystemExtensions.NetStandard.Generators.csproj index 0a80532..65f4ba1 100644 --- a/SystemExtensions.NetStandard.Generators/SystemExtensions.NetStandard.Generators.csproj +++ b/SystemExtensions.NetStandard.Generators/SystemExtensions.NetStandard.Generators.csproj @@ -5,7 +5,7 @@ true Alexandru Macocian Source generators extensions for netstandard2.0. - 0.1.4 + 0.1.5 latest true true