@@ -283,18 +283,18 @@ public struct UUID {
283283 let uuid : uuid_t
284284
285285 public init ( ) {
286- let u = UnsafeMutablePointer < UInt8 > ( allocatingCapacity : sizeof ( uuid_t. self) )
286+ let u = UnsafeMutablePointer< UInt8> . allocate ( capacity : sizeof ( uuid_t. self) )
287287 defer {
288- u. deallocateCapacity ( sizeof ( uuid_t. self) )
288+ u. deallocate ( capacity : sizeof ( uuid_t. self) )
289289 }
290290 uuid_generate_random ( u)
291291 self . uuid = UUID . uuidFromPointer ( u)
292292 }
293293
294294 public init ( _ string: String ) {
295- let u = UnsafeMutablePointer < UInt8 > ( allocatingCapacity : sizeof ( uuid_t. self) )
295+ let u = UnsafeMutablePointer< UInt8> . allocate ( capacity : sizeof ( uuid_t. self) )
296296 defer {
297- u. deallocateCapacity ( sizeof ( uuid_t. self) )
297+ u. deallocate ( capacity : sizeof ( uuid_t. self) )
298298 }
299299 uuid_parse ( string, u)
300300 self . uuid = UUID . uuidFromPointer ( u)
@@ -310,11 +310,11 @@ public struct UUID {
310310 }
311311
312312 public var string : String {
313- let u = UnsafeMutablePointer < UInt8 > ( allocatingCapacity : sizeof ( uuid_t. self) )
314- let unu = UnsafeMutablePointer < Int8 > ( allocatingCapacity : 37 ) // as per spec. 36 + null
313+ let u = UnsafeMutablePointer< UInt8> . allocate ( capacity : sizeof ( uuid_t. self) )
314+ let unu = UnsafeMutablePointer< Int8> . allocate ( capacity : 37 ) // as per spec. 36 + null
315315 defer {
316- u. deallocateCapacity ( sizeof ( uuid_t. self) )
317- unu. deallocateCapacity ( 37 )
316+ u. deallocate ( capacity : sizeof ( uuid_t. self) )
317+ unu. deallocate ( capacity : 37 )
318318 }
319319 var uu = self . uuid
320320 memcpy ( u, & uu, sizeof ( uuid_t. self) )
@@ -632,9 +632,9 @@ public func formatDate(_ date: Double, format: String, timezone inTimezone: Stri
632632 var time = time_t ( date / 1000.0 )
633633 gmtime_r ( & time, & t)
634634 let maxResults = 1024
635- let results = UnsafeMutablePointer < Int8 > ( allocatingCapacity : maxResults)
635+ let results = UnsafeMutablePointer< Int8> . allocate ( capacity : maxResults)
636636 defer {
637- results. deallocateCapacity ( maxResults)
637+ results. deallocate ( capacity : maxResults)
638638 }
639639 let res = strftime ( results, maxResults, format, & t)
640640 if res > 0 {
@@ -701,8 +701,8 @@ import OpenSSL
701701
702702extension String . UTF8View {
703703 var sha1 : [ UInt8 ] {
704- let bytes = UnsafeMutablePointer < UInt8 > ( allocatingCapacity : Int ( SHA_DIGEST_LENGTH) )
705- defer { bytes. deallocateCapacity ( Int ( SHA_DIGEST_LENGTH) ) }
704+ let bytes = UnsafeMutablePointer< UInt8> . allocate ( capacity : Int ( SHA_DIGEST_LENGTH) )
705+ defer { bytes. deallocate ( capacity : Int ( SHA_DIGEST_LENGTH) ) }
706706
707707 SHA1 ( Array < UInt8 > ( self ) , ( self . count) , bytes)
708708
0 commit comments