Skip to content

Commit b590b34

Browse files
authored
Add @discardableResult to NSArray.write* methods
Make result discardable as it is on Darwin
1 parent 91e5c25 commit b590b34

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Foundation/NSArray.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,14 @@ open class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCo
433433
try pListData.write(to: url, options: .atomic)
434434
}
435435

436+
@discardableResult
436437
@available(*, deprecated)
437438
open func write(toFile path: String, atomically useAuxiliaryFile: Bool) -> Bool {
438439
return write(to: URL(fileURLWithPath: path), atomically: useAuxiliaryFile)
439440
}
440441

441442
// the atomically flag is ignored if url of a type that cannot be written atomically.
443+
@discardableResult
442444
@available(*, deprecated)
443445
open func write(to url: URL, atomically: Bool) -> Bool {
444446
do {

0 commit comments

Comments
 (0)