Procházet zdrojové kódy

Remove the construction of the UnsafePointer

Remove the unnecessary construction of the UnsafePointer as the `sterror` returns a `UnsafeMutablePointer<Int8>!`
Victor Sigler před 7 roky
rodič
revize
16f3d4272d
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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))
     }
 }