Skip to content

Commit 5b3dae9

Browse files
dingobyeparkera
authored andcommitted
Fix redundant access-level modifiers to make corelibs-foundation (swiftlang#1663)
adapted to swiftlang/swift#18623.
1 parent 09b3465 commit 5b3dae9

12 files changed

+22
-22
lines changed

Foundation/Codable.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension DecodingError : LocalizedError {}
2222
// Error Utilities
2323
//===----------------------------------------------------------------------===//
2424

25-
internal extension DecodingError {
25+
extension DecodingError {
2626
/// Returns a `.typeMismatch` error describing the expected type.
2727
///
2828
/// - parameter path: The path of `CodingKey`s taken to decode a value of this type.

Foundation/HTTPCookieStorage.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ open class HTTPCookieStorage: NSObject {
325325
open func sortedCookies(using sortOrder: [NSSortDescriptor]) -> [HTTPCookie] { NSUnimplemented() }
326326
}
327327

328-
public extension Notification.Name {
328+
extension Notification.Name {
329329
/*!
330330
@const NSHTTPCookieManagerCookiesChangedNotification
331331
@abstract Notification sent when the set of cookies changes

Foundation/JSONEncoder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2474,7 +2474,7 @@ fileprivate var _iso8601Formatter: ISO8601DateFormatter = {
24742474
// Error Utilities
24752475
//===----------------------------------------------------------------------===//
24762476

2477-
fileprivate extension EncodingError {
2477+
extension EncodingError {
24782478
/// Returns a `.invalidValue` error describing the given invalid floating-point value.
24792479
///
24802480
///

Foundation/NSError.swift

+9-9
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: SignedIn
421421
}
422422
}
423423

424-
public extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: SignedInteger {
424+
extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: SignedInteger {
425425
public var _domain: String { return Self._nsErrorDomain }
426426
public var _code: Int { return Int(rawValue) }
427427

@@ -447,7 +447,7 @@ extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: Unsigned
447447
}
448448
}
449449

450-
public extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: UnsignedInteger {
450+
extension __BridgedNSError where Self: RawRepresentable, Self.RawValue: UnsignedInteger {
451451
public var _domain: String { return Self._nsErrorDomain }
452452
public var _code: Int {
453453
return Int(bitPattern: UInt(rawValue))
@@ -499,7 +499,7 @@ public protocol _BridgedStoredNSError : __BridgedNSError, _ObjectiveCBridgeableE
499499
}
500500

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

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

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

537537
/// Implementation of __BridgedNSError for all _BridgedStoredNSErrors.
538-
public extension _BridgedStoredNSError {
538+
extension _BridgedStoredNSError {
539539
/// Default implementation of ``init(_bridgedNSError)`` to provide
540540
/// bridging from NSError.
541541
public init?(_bridgedNSError error: NSError) {
@@ -690,7 +690,7 @@ public extension CocoaError {
690690
}
691691
}
692692

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

858-
public extension URLError {
858+
extension URLError {
859859
private var _nsUserInfo: [AnyHashable : Any] {
860860
return _nsError.userInfo
861861
}
@@ -871,7 +871,7 @@ public extension URLError {
871871
}
872872
}
873873

874-
public extension URLError {
874+
extension URLError {
875875
public static var unknown: URLError.Code { return .unknown }
876876
public static var cancelled: URLError.Code { return .cancelled }
877877
public static var badURL: URLError.Code { return .badURL }

Foundation/NSLocale.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ extension NSLocale.Key {
220220
}
221221

222222

223-
public extension NSLocale {
223+
extension NSLocale {
224224
public static let currentLocaleDidChangeNotification = NSNotification.Name(rawValue: "kCFLocaleCurrentLocaleDidChangeNotification")
225225
}
226226

Foundation/NSPathUtilities.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public func NSTemporaryDirectory() -> String {
3333
return "/tmp/"
3434
}
3535

36-
internal extension String {
36+
extension String {
3737

3838
internal var _startOfLastPathComponent : String.Index {
3939
precondition(!hasSuffix("/") && length > 1)
@@ -153,7 +153,7 @@ internal extension String {
153153
}
154154
}
155155

156-
public extension NSString {
156+
extension NSString {
157157

158158
public var isAbsolutePath: Bool {
159159
return hasPrefix("~") || hasPrefix("/")

Foundation/Operation.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ open class BlockOperation: Operation {
230230
}
231231
}
232232

233-
public extension OperationQueue {
233+
extension OperationQueue {
234234
public static let defaultMaxConcurrentOperationCount: Int = Int.max
235235
}
236236

Foundation/URLCredentialStorage.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extension URLCredentialStorage {
9898
public func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask) { NSUnimplemented() }
9999
}
100100

101-
public extension Notification.Name {
101+
extension Notification.Name {
102102
/*!
103103
@const NSURLCredentialStorageChangedNotification
104104
@abstract This notification is sent on the main thread whenever

Foundation/URLSession/BodySource.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ internal final class _BodyFileSource {
146146
}
147147
}
148148

149-
fileprivate extension _BodyFileSource {
149+
extension _BodyFileSource {
150150
fileprivate var desiredBufferLength: Int { return 3 * CFURLSessionMaxWriteSize }
151151
/// Enqueue a dispatch I/O read to fill the buffer.
152152
///

Foundation/URLSession/URLSessionTask.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ extension URLSessionTask : ProgressReporting {
321321
}
322322
}
323323

324-
internal extension URLSessionTask {
324+
extension URLSessionTask {
325325
/// Updates the (public) state based on private / internal state.
326326
///
327327
/// - Note: This must be called on the `workQueue`.
@@ -389,7 +389,7 @@ fileprivate func errorCode(fileSystemError error: Error) -> Int {
389389
}
390390
}
391391

392-
public extension URLSessionTask {
392+
extension URLSessionTask {
393393
/// The default URL session task priority, used implicitly for any task you
394394
/// have not prioritized. The floating point value of this constant is 0.5.
395395
public static let defaultPriority: Float = 0.5

Foundation/URLSession/libcurl/EasyHandle.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ fileprivate extension _EasyHandle {
537537
return d
538538
}
539539

540-
fileprivate func setCookies(headerData data: Data) {
540+
func setCookies(headerData data: Data) {
541541
guard let config = _config, config.httpCookieAcceptPolicy != HTTPCookie.AcceptPolicy.never else { return }
542542
guard let headerData = String(data: data, encoding: String.Encoding.utf8) else { return }
543543
//Convert headerData from a string to a dictionary.

Foundation/Unit.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ open class UnitConverterLinear : UnitConverter, NSSecureCoding {
9797
private class UnitConverterReciprocal : UnitConverter, NSSecureCoding {
9898

9999

100-
private private(set) var reciprocal: Double
100+
private var reciprocal: Double
101101

102102

103103
fileprivate init(reciprocal: Double) {

0 commit comments

Comments
 (0)