Ver Fonte

Remove the construction of the UnsafePointer

Remove the unnecessary construction of the UnsafePointer as the `sterror` returns a `UnsafeMutablePointer<Int8>!`
Victor Sigler há 7 anos atrás
pai
commit
16f3d4272d
1 ficheiros alterados com 2 adições e 1 exclusões
  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))
     }
 }