Skip to content

Commit 6d5e0eb

Browse files
committed
Mark FileManager.createFile as @discardableResult
On iOS / macOS this API comes from Objective-C which is implicitly @discardableResult, this means it doesn't warn on those platforms, but previously did on Linux
1 parent eccf74b commit 6d5e0eb

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
@@ -1319,7 +1319,8 @@ open class FileManager : NSObject {
13191319
open func contents(atPath path: String) -> Data? {
13201320
return try? Data(contentsOf: URL(fileURLWithPath: path))
13211321
}
1322-
1322+
1323+
@discardableResult
13231324
open func createFile(atPath path: String, contents data: Data?, attributes attr: [FileAttributeKey : Any]? = nil) -> Bool {
13241325
do {
13251326
try (data ?? Data()).write(to: URL(fileURLWithPath: path), options: .atomic)

0 commit comments

Comments
 (0)