Skip to content

Commit 598f805

Browse files
authored
Merge pull request #1742 from keith/ks/discardable-create
Mark FileManager.createFile as @discardableResult
2 parents 95988ac + 6d5e0eb commit 598f805

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Foundation/FileManager.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,8 @@ open class FileManager : NSObject {
14801480
open func contents(atPath path: String) -> Data? {
14811481
return try? Data(contentsOf: URL(fileURLWithPath: path))
14821482
}
1483-
1483+
1484+
@discardableResult
14841485
open func createFile(atPath path: String, contents data: Data?, attributes attr: [FileAttributeKey : Any]? = nil) -> Bool {
14851486
do {
14861487
try (data ?? Data()).write(to: URL(fileURLWithPath: path), options: .atomic)

0 commit comments

Comments
 (0)