mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words
This commit is contained in:
@@ -11,7 +11,7 @@ import Foundation
|
||||
@_silgen_name("random") func random() -> UInt32
|
||||
@_silgen_name("srandomdev") func srandomdev()
|
||||
|
||||
protocol TestableUnicodeCodec : UnicodeCodecType {
|
||||
protocol TestableUnicodeCodec : UnicodeCodec {
|
||||
typealias CodeUnit : Integer
|
||||
static func encodingId() -> NSStringEncoding
|
||||
static func name() -> NSString
|
||||
@@ -63,7 +63,7 @@ func nthUnicodeScalar(n: UInt32) -> UnicodeScalar {
|
||||
return UnicodeScalar(r.endIndex - (count - n))
|
||||
}
|
||||
}
|
||||
_preconditionFailure("Index out of range")
|
||||
_requirementFailure("Index out of range")
|
||||
}
|
||||
|
||||
// `buffer` should have a length >= 4
|
||||
@@ -74,7 +74,7 @@ func nsEncode<CodeUnit>(
|
||||
inout _ used: Int
|
||||
) {
|
||||
var c = c
|
||||
_precondition(buffer.count >= 4, "buffer is not large enough")
|
||||
_require(buffer.count >= 4, "buffer is not large enough")
|
||||
|
||||
let s = NSString(
|
||||
bytes: &c,
|
||||
|
||||
Reference in New Issue
Block a user