Skip to content

Fix redundant access-level modifiers. #1663

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
Aug 28, 2018
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
2 changes: 1 addition & 1 deletion Foundation/Codable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Error Utilities
//===----------------------------------------------------------------------===//

internal extension DecodingError {
extension DecodingError {
/// Returns a `.typeMismatch` error describing the expected type.
///
/// - parameter path: The path of `CodingKey`s taken to decode a value of this type.
Expand Down
2 changes: 1 addition & 1 deletion Foundation/HTTPCookieStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ open class HTTPCookieStorage: NSObject {
open func sortedCookies(using sortOrder: [NSSortDescriptor]) -> [HTTPCookie] { NSUnimplemented() }
}

public extension Notification.Name {
extension Notification.Name {
/*!
@const NSHTTPCookieManagerCookiesChangedNotification
@abstract Notification sent when the set of cookies changes
Expand Down
2 changes: 1 addition & 1 deletion Foundation/JSONEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ fileprivate var _iso8601Formatter: ISO8601DateFormatter = {
// Error Utilities
//===----------------------------------------------------------------------===//

fileprivate extension EncodingError {
extension EncodingError {
/// Returns a `.invalidValue` error describing the given invalid floating-point value.
///
///
Expand Down
18 changes: 9 additions & 9 deletions Foundation/NSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: SignedIn
}
}

public extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: SignedInteger {
extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: SignedInteger {
public var _domain: String { return Self._nsErrorDomain }
public var _code: Int { return Int(rawValue) }

Expand All @@ -447,7 +447,7 @@ extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: Unsigned
}
}

public extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: UnsignedInteger {
extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: UnsignedInteger {
public var _domain: String { return Self._nsErrorDomain }
public var _code: Int {
return Int(bitPattern: UInt(rawValue))
Expand Down Expand Up @@ -499,7 +499,7 @@ public protocol _BridgedStoredNSError : __BridgedNSError, _ObjectiveCBridgeableE
}

/// Various helper implementations for _BridgedStoredNSError
public extension _BridgedStoredNSError where Code: RawRepresentable, Code.RawValue: SignedInteger {
extension _BridgedStoredNSError where Code: RawRepresentable, Code.RawValue: SignedInteger {
// FIXME: Generalize to Integer.
public var code: Code {
return Code(rawValue: numericCast(_nsError.code))!
Expand All @@ -515,11 +515,11 @@ public extension _BridgedStoredNSError where Code: RawRepresentable, Code.RawVal

/// The user-info dictionary for an error that was bridged from
/// NSError.
var userInfo: [String : Any] { return errorUserInfo }
public var userInfo: [String : Any] { return errorUserInfo }
}

/// Various helper implementations for _BridgedStoredNSError
public extension _BridgedStoredNSError where Code: RawRepresentable, Code.RawValue: UnsignedInteger {
extension _BridgedStoredNSError where Code: RawRepresentable, Code.RawValue: UnsignedInteger {
// FIXME: Generalize to Integer.
public var code: Code {
return Code(rawValue: numericCast(_nsError.code))!
Expand All @@ -535,7 +535,7 @@ public extension _BridgedStoredNSError where Code: RawRepresentable, Code.RawVal
}

/// Implementation of __BridgedNSError for all _BridgedStoredNSErrors.
public extension _BridgedStoredNSError {
extension _BridgedStoredNSError {
/// Default implementation of ``init(_bridgedNSError)`` to provide
/// bridging from NSError.
public init?(_bridgedNSError error: NSError) {
Expand Down Expand Up @@ -690,7 +690,7 @@ public extension CocoaError {
}
}

public extension CocoaError {
extension CocoaError {
public static func error(_ code: CocoaError.Code, userInfo: [AnyHashable: Any]? = nil, url: URL? = nil) -> Error {
var info: [String: Any] = userInfo as? [String: Any] ?? [:]
if let url = url {
Expand Down Expand Up @@ -855,7 +855,7 @@ public struct URLError : _BridgedStoredNSError {
}
}

public extension URLError {
extension URLError {
private var _nsUserInfo: [AnyHashable : Any] {
return _nsError.userInfo
}
Expand All @@ -871,7 +871,7 @@ public extension URLError {
}
}

public extension URLError {
extension URLError {
public static var unknown: URLError.Code { return .unknown }
public static var cancelled: URLError.Code { return .cancelled }
public static var badURL: URLError.Code { return .badURL }
Expand Down
2 changes: 1 addition & 1 deletion Foundation/NSLocale.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ extension NSLocale.Key {
}


public extension NSLocale {
extension NSLocale {
public static let currentLocaleDidChangeNotification = NSNotification.Name(rawValue: "kCFLocaleCurrentLocaleDidChangeNotification")
}

Expand Down
4 changes: 2 additions & 2 deletions Foundation/NSPathUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public func NSTemporaryDirectory() -> String {
return "/tmp/"
}

internal extension String {
extension String {

internal var _startOfLastPathComponent : String.Index {
precondition(!hasSuffix("/") && length > 1)
Expand Down Expand Up @@ -153,7 +153,7 @@ internal extension String {
}
}

public extension NSString {
extension NSString {

public var isAbsolutePath: Bool {
return hasPrefix("~") || hasPrefix("/")
Expand Down
2 changes: 1 addition & 1 deletion Foundation/Operation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ open class BlockOperation: Operation {
}
}

public extension OperationQueue {
extension OperationQueue {
public static let defaultMaxConcurrentOperationCount: Int = Int.max
}

Expand Down
2 changes: 1 addition & 1 deletion Foundation/URLCredentialStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ extension URLCredentialStorage {
public func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) { NSUnimplemented() }
}

public extension Notification.Name {
extension Notification.Name {
/*!
@const NSURLCredentialStorageChangedNotification
@abstract This notification is sent on the main thread whenever
Expand Down
2 changes: 1 addition & 1 deletion Foundation/URLSession/BodySource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ internal final class _BodyFileSource {
}
}

fileprivate extension _BodyFileSource {
extension _BodyFileSource {
fileprivate var desiredBufferLength: Int { return 3 * CFURLSessionMaxWriteSize }
/// Enqueue a dispatch I/O read to fill the buffer.
///
Expand Down
4 changes: 2 additions & 2 deletions Foundation/URLSession/URLSessionTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ extension URLSessionTask : ProgressReporting {
}
}

internal extension URLSessionTask {
extension URLSessionTask {
/// Updates the (public) state based on private / internal state.
///
/// - Note: This must be called on the `workQueue`.
Expand Down Expand Up @@ -389,7 +389,7 @@ fileprivate func errorCode(fileSystemError error: Error) -> Int {
}
}

public extension URLSessionTask {
extension URLSessionTask {
/// The default URL session task priority, used implicitly for any task you
/// have not prioritized. The floating point value of this constant is 0.5.
public static let defaultPriority: Float = 0.5
Expand Down
2 changes: 1 addition & 1 deletion Foundation/URLSession/libcurl/EasyHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ fileprivate extension _EasyHandle {
return d
}

fileprivate func setCookies(headerData data: Data) {
func setCookies(headerData data: Data) {
guard let config = _config, config.httpCookieAcceptPolicy != HTTPCookie.AcceptPolicy.never else { return }
guard let headerData = String(data: data, encoding: String.Encoding.utf8) else { return }
//Convert headerData from a string to a dictionary.
Expand Down
2 changes: 1 addition & 1 deletion Foundation/Unit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ open class UnitConverterLinear : UnitConverter, NSSecureCoding {
private class UnitConverterReciprocal : UnitConverter, NSSecureCoding {


private private(set) var reciprocal: Double
private var reciprocal: Double


fileprivate init(reciprocal: Double) {
Expand Down