1
0
Эх сурвалжийг харах

Remove the construction of the UnsafePointer

Remove the unnecessary construction of the UnsafePointer as the `sterror` returns a `UnsafeMutablePointer<Int8>!`
Victor Sigler 7 жил өмнө
parent
commit
16f3d4272d
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      Sources/Errno.swift

+ 2 - 1
Sources/Errno.swift

@@ -10,6 +10,7 @@ import Foundation
 public class Errno {
     
     public class func description() -> String {
-        return String(cString: UnsafePointer(strerror(errno)))
+        // https://forums.developer.apple.com/thread/113919
+        return String(cString: strerror(errno))
     }
 }