From 31a2e200117d048344efc8fe81e7cb8e09ce1ff3 Mon Sep 17 00:00:00 2001 From: badcel <1218031+badcel@users.noreply.github.com> Date: Tue, 28 May 2024 22:28:47 +0200 Subject: [PATCH] Untyped record: Remove obsolete unsafe keyword --- .../Generator/Renderer/Internal/UntypedRecordHandle.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Generation/Generator/Renderer/Internal/UntypedRecordHandle.cs b/src/Generation/Generator/Renderer/Internal/UntypedRecordHandle.cs index 7b60df325..8934bcb33 100644 --- a/src/Generation/Generator/Renderer/Internal/UntypedRecordHandle.cs +++ b/src/Generation/Generator/Renderer/Internal/UntypedRecordHandle.cs @@ -255,7 +255,7 @@ private static string RenderFieldGetter(GirModel.Record record, GirModel.Field f var typePrefix = field.AnyTypeOrCallback.IsT1 ? $"{Model.UntypedRecord.GetDataName(record)}." : string.Empty; var dataName = Model.UntypedRecord.GetDataName(record); - return @$"public unsafe {typePrefix}{renderableField.NullableTypeName} Get{renderableField.Name}() + return @$"public {typePrefix}{renderableField.NullableTypeName} Get{renderableField.Name}() {{ if (IsClosed || IsInvalid) throw new InvalidOperationException(""Handle is closed or invalid""); @@ -268,7 +268,7 @@ private static string RenderFieldSetter(GirModel.Record record, GirModel.Field f { var dataName = Model.UntypedRecord.GetDataName(record); - return @$"public unsafe void Set{renderableField.Name}({renderableField.NullableTypeName} value) + return @$"public void Set{renderableField.Name}({renderableField.NullableTypeName} value) {{ if (IsClosed || IsInvalid) throw new InvalidOperationException(""Handle is closed or invalid"");