Skip to content

Commit 9cd298b

Browse files
committed
remove usages of @warn_unused_result since it is now the default
1 parent 82ebaa6 commit 9cd298b

File tree

8 files changed

+0
-74
lines changed

8 files changed

+0
-74
lines changed

Foundation/CharacterSet.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,13 +402,11 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
402402
}
403403

404404
/// Test for membership of a particular `UnicodeScalar` in the `CharacterSet`.
405-
@warn_unused_result
406405
public func contains(_ member: UnicodeScalar) -> Bool {
407406
return _mapUnmanaged { $0.longCharacterIsMember(member.value) }
408407
}
409408

410409
/// Returns a union of the `CharacterSet` with another `CharacterSet`.
411-
@warn_unused_result
412410
public func union(_ other: CharacterSet) -> CharacterSet {
413411
// The underlying collection does not have a method to return new CharacterSets with changes applied, so we will copy and apply here
414412
var result = self
@@ -422,7 +420,6 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
422420
}
423421

424422
/// Returns an intersection of the `CharacterSet` with another `CharacterSet`.
425-
@warn_unused_result
426423
public func intersection(_ other: CharacterSet) -> CharacterSet {
427424
// The underlying collection does not have a method to return new CharacterSets with changes applied, so we will copy and apply here
428425
var result = self
@@ -438,7 +435,6 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
438435
}
439436

440437
/// Returns the exclusive or of the `CharacterSet` with another `CharacterSet`.
441-
@warn_unused_result
442438
public func symmetricDifference(_ other: CharacterSet) -> CharacterSet {
443439
return union(other).subtracting(intersection(other))
444440
}
@@ -449,7 +445,6 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
449445
}
450446

451447
/// Returns true if `self` is a superset of `other`.
452-
@warn_unused_result
453448
public func isSuperset(of other: CharacterSet) -> Bool {
454449
return _mapUnmanaged { $0.isSuperset(of: other) }
455450
}
@@ -492,7 +487,6 @@ extension CharacterSet {
492487
}
493488

494489
extension CharacterSet {
495-
@warn_unused_result
496490
public func contains(_ member: unichar) -> Bool {
497491
return contains(UnicodeScalar(member))
498492
}

Foundation/Data.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
369369
/// - parameter buffer: A buffer to copy the data into.
370370
/// - parameter range: A range in the data to copy into the buffer. If the range is empty, this function will return 0 without copying anything. If the range is nil, as much data as will fit into `buffer` is copied.
371371
/// - returns: Number of bytes copied into the destination buffer.
372-
@warn_unused_result
373372
public func copyBytes<DestinationType>(to buffer: UnsafeMutableBufferPointer<DestinationType>, from range: Range<Index>? = nil) -> Int {
374373
let cnt = count
375374
guard cnt > 0 else { return 0 }

Foundation/NSCoder.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public class NSCoder : NSObject {
4646
NSRequiresConcreteImplementation()
4747
}
4848

49-
@warn_unused_result
5049
public func decodeObjectOfClass<DecodedObjectType : NSCoding where DecodedObjectType : NSObject>(_ cls: DecodedObjectType.Type, forKey key: String) -> DecodedObjectType? {
5150
NSUnimplemented()
5251
}
@@ -62,22 +61,18 @@ public class NSCoder : NSObject {
6261
be casted to NSObject, nor is it Hashable.
6362
*/
6463
/// - Experiment: This is a draft API currently under consideration for official import into Foundation
65-
@warn_unused_result
6664
public func decodeObjectOfClasses(_ classes: [AnyClass], forKey key: String) -> AnyObject? {
6765
NSUnimplemented()
6866
}
6967

70-
@warn_unused_result
7168
public func decodeTopLevelObject() throws -> AnyObject? {
7269
NSUnimplemented()
7370
}
7471

75-
@warn_unused_result
7672
public func decodeTopLevelObjectForKey(_ key: String) throws -> AnyObject? {
7773
NSUnimplemented()
7874
}
7975

80-
@warn_unused_result
8176
public func decodeTopLevelObjectOfClass<DecodedObjectType : NSCoding where DecodedObjectType : NSObject>(_ cls: DecodedObjectType.Type, forKey key: String) throws -> DecodedObjectType? {
8277
NSUnimplemented()
8378
}
@@ -93,7 +88,6 @@ public class NSCoder : NSObject {
9388
be casted to NSObject, nor is it Hashable.
9489
*/
9590
/// - Experiment: This is a draft API currently under consideration for official import into Foundation
96-
@warn_unused_result
9791
public func decodeTopLevelObjectOfClasses(_ classes: [AnyClass], forKey key: String) throws -> AnyObject? {
9892
NSUnimplemented()
9993
}

Foundation/NSError.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ public protocol __BridgedNSError : RawRepresentable, ErrorProtocol {
192192
static var __NSErrorDomain: String { get }
193193
}
194194

195-
@warn_unused_result
196195
public func ==<T: __BridgedNSError where T.RawValue: SignedInteger>(lhs: T, rhs: T) -> Bool {
197196
return lhs.rawValue.toIntMax() == rhs.rawValue.toIntMax()
198197
}
@@ -216,7 +215,6 @@ public extension __BridgedNSError where RawValue: SignedInteger {
216215
public final var hashValue: Int { return _code }
217216
}
218217

219-
@warn_unused_result
220218
public func ==<T: __BridgedNSError where T.RawValue: UnsignedInteger>(lhs: T, rhs: T) -> Bool {
221219
return lhs.rawValue.toUIntMax() == rhs.rawValue.toUIntMax()
222220
}

Foundation/NSKeyedUnarchiver.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,27 +651,22 @@ public class NSKeyedUnarchiver : NSCoder {
651651
return nil
652652
}
653653

654-
@warn_unused_result
655654
public override func decodeObjectOfClass<DecodedObjectType : NSCoding where DecodedObjectType : NSObject>(_ cls: DecodedObjectType.Type, forKey key: String) -> DecodedObjectType? {
656655
return decodeObjectOfClasses([cls], forKey: key) as? DecodedObjectType
657656
}
658657

659-
@warn_unused_result
660658
public override func decodeObjectOfClasses(_ classes: [AnyClass], forKey key: String) -> AnyObject? {
661659
return _decodeObjectOfClasses(classes, forKey: key)
662660
}
663661

664-
@warn_unused_result
665662
public override func decodeTopLevelObjectForKey(_ key: String) throws -> AnyObject? {
666663
return try decodeTopLevelObjectOfClasses([NSArray.self], forKey: key)
667664
}
668665

669-
@warn_unused_result
670666
public override func decodeTopLevelObjectOfClass<DecodedObjectType : NSCoding where DecodedObjectType : NSObject>(_ cls: DecodedObjectType.Type, forKey key: String) throws -> DecodedObjectType? {
671667
return try self.decodeTopLevelObjectOfClasses([cls], forKey: key) as! DecodedObjectType?
672668
}
673669

674-
@warn_unused_result
675670
public override func decodeTopLevelObjectOfClasses(_ classes: [AnyClass], forKey key: String) throws -> AnyObject? {
676671
guard self._containers?.count == 1 else {
677672
throw _decodingError(NSCocoaError.CoderReadCorruptError,
@@ -895,7 +890,6 @@ public class NSKeyedUnarchiver : NSCoder {
895890
}
896891

897892
extension NSKeyedUnarchiver {
898-
@warn_unused_result
899893
public class func unarchiveTopLevelObjectWithData(_ data: Data) throws -> AnyObject? {
900894
var root : AnyObject? = nil
901895

Foundation/NSRange.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ extension NSRange {
4343
length = x.count
4444
}
4545

46-
@warn_unused_result
4746
public func toRange() -> CountableRange<Int>? {
4847
if location == NSNotFound { return nil }
4948
let min = location

Foundation/NSSwiftRuntime.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ public protocol _ObjectTypeBridgeable {
214214
associatedtype _ObjectType : AnyObject
215215

216216
/// Convert `self` to an Object type
217-
@warn_unused_result
218217
func _bridgeToObject() -> _ObjectType
219218

220219
/// Bridge from an object of the bridged class type to a value of

0 commit comments

Comments
 (0)