File tree Expand file tree Collapse file tree 6 files changed +11
-20
lines changed
Sources/BinaryCodable/BinaryDataCoders Expand file tree Collapse file tree 6 files changed +11
-20
lines changed Original file line number Diff line number Diff line change 1- 4 .2
1+ 5 .2
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ Pod::Spec.new do |s|
88 s . source = { :git => 'https://github.com/jverkoey/BinaryCodable.git' , :tag => s . version }
99 s . documentation_url = 'https://github.com/jverkoey/BinaryCodable/'
1010
11- s . ios . deployment_target = '12 .0'
12- s . osx . deployment_target = '10.12 '
11+ s . ios . deployment_target = '13 .0'
12+ s . osx . deployment_target = '10.15 '
1313
1414 s . source_files = [ 'Sources/**/*.swift' ]
1515end
Original file line number Diff line number Diff line change 1- // swift-tools-version:4 .2
1+ // swift-tools-version:5 .2
22// Copyright 2019-present the BinaryCodable authors. All Rights Reserved.
33//
44// Licensed under the Apache License, Version 2.0 (the "License");
Original file line number Diff line number Diff line change @@ -39,11 +39,10 @@ This is not an official Google product.
3939
4040## Supported technologies
4141
42- - iOS 12 .0+ / macOS 10.12 +
43- - Xcode 10.1 +
42+ - iOS 13 .0+ / macOS 10.15 +
43+ - Xcode 11.5 +
4444- Ubuntu 16.04
45- - Swift 4.2.4
46- - Swift 5.1.3
45+ - Swift 5.2
4746
4847## License
4948
Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ private class BinaryDataDecodingContainer: BinaryDecodingContainer {
111111 throw BinaryDecodingError . dataCorrupted ( . init( debugDescription:
112112 " Not enough data to create a a type of \( type) . Needed: \( byteWidth) . Received: \( bytes. count) . " ) )
113113 }
114- let value = bytes. withUnsafeBytes { ( ptr: UnsafePointer < T > ) -> T in
115- return ptr. pointee
114+ let value = bytes. withUnsafeBytes { ptr -> T in
115+ return ptr. load ( as : T . self )
116116 }
117117 return value
118118 }
@@ -124,8 +124,8 @@ private class BinaryDataDecodingContainer: BinaryDecodingContainer {
124124 throw BinaryDecodingError . dataCorrupted ( . init( debugDescription:
125125 " Not enough data to create a a type of \( type) . Needed: \( byteWidth) . Received: \( bytes. count) . " ) )
126126 }
127- let value = bytes. withUnsafeBytes { ( ptr: UnsafePointer < T > ) -> T in
128- return ptr. pointee
127+ let value = bytes. withUnsafeBytes { ptr -> T in
128+ return ptr. load ( as : T . self )
129129 }
130130 return value
131131 }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments