Skip to content

Commit

Permalink
Remove the construction of the UnsafePointer
Browse files Browse the repository at this point in the history
Remove the unnecessary construction of the UnsafePointer as the `sterror` returns a `UnsafeMutablePointer<Int8>!`
  • Loading branch information
Vkt0r committed Mar 30, 2019
1 parent 82549f1 commit 16f3d42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Errno.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

0 comments on commit 16f3d42

Please sign in to comment.