소스 검색

Remove the construction of the UnsafePointer

Remove the unnecessary construction of the UnsafePointer as the `sterror` returns a `UnsafeMutablePointer<Int8>!`
Victor Sigler 7 년 전
부모
커밋
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))
     }
 }