Skip to content

[Gardening] Replaced many instances of ' : ' with ': ' #26218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions stdlib/public/core/ASCII.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ extension Unicode {
public enum ASCII {}
}

extension Unicode.ASCII : Unicode.Encoding {
extension Unicode.ASCII: Unicode.Encoding {
public typealias CodeUnit = UInt8
public typealias EncodedScalar = CollectionOfOne<CodeUnit>

@inlinable
public static var encodedReplacementCharacter : EncodedScalar {
public static var encodedReplacementCharacter: EncodedScalar {
return EncodedScalar(0x1a) // U+001A SUBSTITUTE; best we can do for ASCII
}

Expand Down Expand Up @@ -51,7 +51,7 @@ extension Unicode.ASCII : Unicode.Encoding {

@inline(__always)
@inlinable
public static func transcode<FromEncoding : Unicode.Encoding>(
public static func transcode<FromEncoding: Unicode.Encoding>(
_ content: FromEncoding.EncodedScalar, from _: FromEncoding.Type
) -> EncodedScalar? {
if _fastPath(FromEncoding.self == UTF16.self) {
Expand All @@ -78,12 +78,12 @@ extension Unicode.ASCII : Unicode.Encoding {
public typealias ReverseParser = Parser
}

extension Unicode.ASCII.Parser : Unicode.Parser {
extension Unicode.ASCII.Parser: Unicode.Parser {
public typealias Encoding = Unicode.ASCII

/// Parses a single Unicode scalar value from `input`.
@inlinable
public mutating func parseScalar<I : IteratorProtocol>(
public mutating func parseScalar<I: IteratorProtocol>(
from input: inout I
) -> Unicode.ParseResult<Encoding.EncodedScalar>
where I.Element == Encoding.CodeUnit {
Expand Down
8 changes: 4 additions & 4 deletions stdlib/public/core/Algorithm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/// - y: Another value to compare.
/// - Returns: The lesser of `x` and `y`. If `x` is equal to `y`, returns `x`.
@inlinable // protocol-only
public func min<T : Comparable>(_ x: T, _ y: T) -> T {
public func min<T: Comparable>(_ x: T, _ y: T) -> T {
// In case `x == y` we pick `x`.
// This preserves any pre-existing order in case `T` has identity,
// which is important for e.g. the stability of sorting algorithms.
Expand All @@ -35,7 +35,7 @@ public func min<T : Comparable>(_ x: T, _ y: T) -> T {
/// - Returns: The least of all the arguments. If there are multiple equal
/// least arguments, the result is the first one.
@inlinable // protocol-only
public func min<T : Comparable>(_ x: T, _ y: T, _ z: T, _ rest: T...) -> T {
public func min<T: Comparable>(_ x: T, _ y: T, _ z: T, _ rest: T...) -> T {
var minValue = min(min(x, y), z)
// In case `value == minValue`, we pick `minValue`. See min(_:_:).
for value in rest where value < minValue {
Expand All @@ -51,7 +51,7 @@ public func min<T : Comparable>(_ x: T, _ y: T, _ z: T, _ rest: T...) -> T {
/// - y: Another value to compare.
/// - Returns: The greater of `x` and `y`. If `x` is equal to `y`, returns `y`.
@inlinable // protocol-only
public func max<T : Comparable>(_ x: T, _ y: T) -> T {
public func max<T: Comparable>(_ x: T, _ y: T) -> T {
// In case `x == y`, we pick `y`. See min(_:_:).
return y >= x ? y : x
}
Expand All @@ -66,7 +66,7 @@ public func max<T : Comparable>(_ x: T, _ y: T) -> T {
/// - Returns: The greatest of all the arguments. If there are multiple equal
/// greatest arguments, the result is the last one.
@inlinable // protocol-only
public func max<T : Comparable>(_ x: T, _ y: T, _ z: T, _ rest: T...) -> T {
public func max<T: Comparable>(_ x: T, _ y: T, _ z: T, _ rest: T...) -> T {
var maxValue = max(max(x, y), z)
// In case `value == maxValue`, we pick `value`. See min(_:_:).
for value in rest where value >= maxValue {
Expand Down
32 changes: 16 additions & 16 deletions stdlib/public/core/AnyHashable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public protocol _HasCustomAnyHashableRepresentation {
/// needs to be boxed into `AnyHashable` using the static
/// type that introduces the `Hashable` conformance.
///
/// class Base : Hashable {}
/// class Derived1 : Base {}
/// class Derived2 : Base, _HasCustomAnyHashableRepresentation {
/// class Base: Hashable {}
/// class Derived1: Base {}
/// class Derived2: Base, _HasCustomAnyHashableRepresentation {
/// func _toCustomAnyHashable() -> AnyHashable? {
/// // `Derived2` is canonicalized to `Derived1`.
/// let customRepresentation = Derived1()
Expand Down Expand Up @@ -62,14 +62,14 @@ extension _AnyHashableBox {
}
}

internal struct _ConcreteHashableBox<Base : Hashable> : _AnyHashableBox {
internal struct _ConcreteHashableBox<Base: Hashable>: _AnyHashableBox {
internal var _baseHashable: Base

internal init(_ base: Base) {
self._baseHashable = base
}

internal func _unbox<T : Hashable>() -> T? {
internal func _unbox<T: Hashable>() -> T? {
return (self as _AnyHashableBox as? _ConcreteHashableBox<T>)?._baseHashable
}

Expand Down Expand Up @@ -134,7 +134,7 @@ public struct AnyHashable {
/// Creates a type-erased hashable value that wraps the given instance.
///
/// - Parameter base: A hashable value to wrap.
public init<H : Hashable>(_ base: H) {
public init<H: Hashable>(_ base: H) {
if let custom =
(base as? _HasCustomAnyHashableRepresentation)?._toCustomAnyHashable() {
self = custom
Expand All @@ -147,7 +147,7 @@ public struct AnyHashable {
storingResultInto: &self)
}

internal init<H : Hashable>(_usingDefaultRepresentationOf base: H) {
internal init<H: Hashable>(_usingDefaultRepresentationOf base: H) {
self._box = _ConcreteHashableBox(base)
}

Expand Down Expand Up @@ -187,7 +187,7 @@ public struct AnyHashable {
}
}

extension AnyHashable : Equatable {
extension AnyHashable: Equatable {
/// Returns a Boolean value indicating whether two type-erased hashable
/// instances wrap the same type and value.
///
Expand All @@ -203,7 +203,7 @@ extension AnyHashable : Equatable {
}
}

extension AnyHashable : Hashable {
extension AnyHashable: Hashable {
/// The hash value.
public var hashValue: Int {
return _box._canonicalBox._hashValue
Expand All @@ -223,19 +223,19 @@ extension AnyHashable : Hashable {
}
}

extension AnyHashable : CustomStringConvertible {
extension AnyHashable: CustomStringConvertible {
public var description: String {
return String(describing: base)
}
}

extension AnyHashable : CustomDebugStringConvertible {
extension AnyHashable: CustomDebugStringConvertible {
public var debugDescription: String {
return "AnyHashable(" + String(reflecting: base) + ")"
}
}

extension AnyHashable : CustomReflectable {
extension AnyHashable: CustomReflectable {
public var customMirror: Mirror {
return Mirror(
self,
Expand All @@ -250,7 +250,7 @@ extension AnyHashable : CustomReflectable {
/// conformance, if it exists.
/// Called by AnyHashableSupport.cpp.
@_silgen_name("_swift_makeAnyHashableUsingDefaultRepresentation")
internal func _makeAnyHashableUsingDefaultRepresentation<H : Hashable>(
internal func _makeAnyHashableUsingDefaultRepresentation<H: Hashable>(
of value: H,
storingResultInto result: UnsafeMutablePointer<AnyHashable>
) {
Expand All @@ -259,20 +259,20 @@ internal func _makeAnyHashableUsingDefaultRepresentation<H : Hashable>(

/// Provided by AnyHashable.cpp.
@_silgen_name("_swift_makeAnyHashableUpcastingToHashableBaseType")
internal func _makeAnyHashableUpcastingToHashableBaseType<H : Hashable>(
internal func _makeAnyHashableUpcastingToHashableBaseType<H: Hashable>(
_ value: H,
storingResultInto result: UnsafeMutablePointer<AnyHashable>
)

@inlinable
public // COMPILER_INTRINSIC
func _convertToAnyHashable<H : Hashable>(_ value: H) -> AnyHashable {
func _convertToAnyHashable<H: Hashable>(_ value: H) -> AnyHashable {
return AnyHashable(value)
}

/// Called by the casting machinery.
@_silgen_name("_swift_convertToAnyHashableIndirect")
internal func _convertToAnyHashableIndirect<H : Hashable>(
internal func _convertToAnyHashableIndirect<H: Hashable>(
_ value: H,
_ target: UnsafeMutablePointer<AnyHashable>
) {
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ internal struct _ArrayAnyHashableBox<Element: Hashable>
return hasher._finalize()
}

internal func _unbox<T : Hashable>() -> T? {
internal func _unbox<T: Hashable>() -> T? {
return _value as? T
}

Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/ArrayBuffer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal typealias _ArrayBridgeStorage

@usableFromInline
@frozen
internal struct _ArrayBuffer<Element> : _ArrayBufferProtocol {
internal struct _ArrayBuffer<Element>: _ArrayBufferProtocol {

/// Create an empty buffer.
@inlinable
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/ArrayBufferProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ where Indices == Range<Int> {
_ subrange: Range<Int>,
with newCount: Int,
elementsOf newValues: __owned C
) where C : Collection, C.Element == Element
) where C: Collection, C.Element == Element

/// Returns a `_SliceBuffer` containing the elements in `bounds`.
subscript(bounds: Range<Int>) -> _SliceBuffer<Element> { get }
Expand Down Expand Up @@ -144,7 +144,7 @@ extension _ArrayBufferProtocol where Indices == Range<Int>{
_ subrange: Range<Int>,
with newCount: Int,
elementsOf newValues: __owned C
) where C : Collection, C.Element == Element {
) where C: Collection, C.Element == Element {
_internalInvariant(startIndex == 0, "_SliceBuffer should override this function.")
let oldCount = self.count
let eraseCount = subrange.count
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/core/Bool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public struct Bool {
}
}

extension Bool : _ExpressibleByBuiltinBooleanLiteral, ExpressibleByBooleanLiteral {
extension Bool: _ExpressibleByBuiltinBooleanLiteral, ExpressibleByBooleanLiteral {
@_transparent
public init(_builtinBooleanLiteral value: Builtin.Int1) {
self._value = value
Expand Down Expand Up @@ -170,7 +170,7 @@ extension Bool : _ExpressibleByBuiltinBooleanLiteral, ExpressibleByBooleanLitera
}
}

extension Bool : CustomStringConvertible {
extension Bool: CustomStringConvertible {
/// A textual representation of the Boolean value.
@inlinable
public var description: String {
Expand All @@ -197,7 +197,7 @@ extension Bool: Hashable {
}
}

extension Bool : LosslessStringConvertible {
extension Bool: LosslessStringConvertible {
/// Creates a new Boolean value from the given string.
///
/// If the `description` value is any string other than `"true"` or
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/BridgeObjectiveC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/// or NSDictionary will be the result of calling `_bridgeToObjectiveC`
/// on each element of the source container.
public protocol _ObjectiveCBridgeable {
associatedtype _ObjectiveCType : AnyObject
associatedtype _ObjectiveCType: AnyObject

/// Convert `self` to Objective-C.
func _bridgeToObjectiveC() -> _ObjectiveCType
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/core/Builtin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ public func _unsafeReferenceCast<T, U>(_ x: T, to: U.Type) -> U {
/// - type: The type `T` to which `x` is cast.
/// - Returns: The instance `x`, cast to type `T`.
@_transparent
public func unsafeDowncast<T : AnyObject>(_ x: AnyObject, to type: T.Type) -> T {
public func unsafeDowncast<T: AnyObject>(_ x: AnyObject, to type: T.Type) -> T {
_debugPrecondition(x is T, "invalid unsafeDowncast")
return Builtin.castReference(x)
}

@_transparent
public func _unsafeUncheckedDowncast<T : AnyObject>(_ x: AnyObject, to type: T.Type) -> T {
public func _unsafeUncheckedDowncast<T: AnyObject>(_ x: AnyObject, to type: T.Type) -> T {
_internalInvariant(x is T, "invalid unsafeDowncast")
return Builtin.castReference(x)
}
Expand Down Expand Up @@ -778,7 +778,7 @@ func _trueAfterDiagnostics() -> Builtin.Int1 {
/// }
/// }
///
/// class EmojiSmiley : Smiley {
/// class EmojiSmiley: Smiley {
/// override class var text: String {
/// return "😀"
/// }
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/CString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ extension String {
@_specialize(where Encoding == Unicode.UTF8)
@_specialize(where Encoding == Unicode.UTF16)
@inlinable // Fold away specializations
public static func decodeCString<Encoding : _UnicodeEncoding>(
public static func decodeCString<Encoding: _UnicodeEncoding>(
_ cString: UnsafePointer<Encoding.CodeUnit>?,
as encoding: Encoding.Type,
repairingInvalidCodeUnits isRepairing: Bool = true
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/core/CTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ extension OpaquePointer: Hashable {
}
}

extension OpaquePointer : CustomDebugStringConvertible {
extension OpaquePointer: CustomDebugStringConvertible {
/// A textual representation of the pointer, suitable for debugging.
public var debugDescription: String {
return _rawPointerToString(_rawValue)
Expand Down Expand Up @@ -246,7 +246,7 @@ public struct CVaListPointer {
}
}

extension CVaListPointer : CustomDebugStringConvertible {
extension CVaListPointer: CustomDebugStringConvertible {
public var debugDescription: String {
return "(\(_value.__stack.debugDescription), " +
"\(_value.__gr_top.debugDescription), " +
Expand All @@ -270,7 +270,7 @@ public struct CVaListPointer {
}
}

extension CVaListPointer : CustomDebugStringConvertible {
extension CVaListPointer: CustomDebugStringConvertible {
/// A textual representation of the pointer, suitable for debugging.
public var debugDescription: String {
return _value.debugDescription
Expand Down
10 changes: 5 additions & 5 deletions stdlib/public/core/Character.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,16 @@ extension Character :
}
}

extension Character : CustomStringConvertible {
extension Character: CustomStringConvertible {
@inlinable
public var description: String {
return _str
}
}

extension Character : LosslessStringConvertible { }
extension Character: LosslessStringConvertible { }

extension Character : CustomDebugStringConvertible {
extension Character: CustomDebugStringConvertible {
/// A textual representation of the character, suitable for debugging.
public var debugDescription: String {
return _str.debugDescription
Expand All @@ -211,15 +211,15 @@ extension String {
}
}

extension Character : Equatable {
extension Character: Equatable {
@inlinable @inline(__always)
@_effects(readonly)
public static func == (lhs: Character, rhs: Character) -> Bool {
return lhs._str == rhs._str
}
}

extension Character : Comparable {
extension Character: Comparable {
@inlinable @inline(__always)
@_effects(readonly)
public static func < (lhs: Character, rhs: Character) -> Bool {
Expand Down
Loading