From 39992f7d4f6a1b7ff6875e9f67aec28d01c589d6 Mon Sep 17 00:00:00 2001 From: Thomas Rasch Date: Tue, 11 Jun 2024 18:21:15 +0200 Subject: [PATCH] Code cleanup --- Sources/GISTools/GeoJson/WKBCoder.swift | 12 +++++++----- .../GISToolsTests/Extensions/StringExtensions.swift | 2 -- 2 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 Tests/GISToolsTests/Extensions/StringExtensions.swift diff --git a/Sources/GISTools/GeoJson/WKBCoder.swift b/Sources/GISTools/GeoJson/WKBCoder.swift index ce2b488..1247d8e 100644 --- a/Sources/GISTools/GeoJson/WKBCoder.swift +++ b/Sources/GISTools/GeoJson/WKBCoder.swift @@ -611,11 +611,13 @@ extension WKBCoder { into: inout T) throws { - try read( - bytes: bytes, - offset: &offset, - byteCount: MemoryLayout.size, - into: &into) + try withUnsafeMutablePointer(to: &into) { into in + try read( + bytes: bytes, + offset: &offset, + byteCount: MemoryLayout.size, + into: into) + } } private static func read( diff --git a/Tests/GISToolsTests/Extensions/StringExtensions.swift b/Tests/GISToolsTests/Extensions/StringExtensions.swift deleted file mode 100644 index 2065e22..0000000 --- a/Tests/GISToolsTests/Extensions/StringExtensions.swift +++ /dev/null @@ -1,2 +0,0 @@ - -extension String: Error {}