Skip to content

Commit 3b47b16

Browse files
committed
[Stdlib] Eliminate the _UnicodeEncoding_ protocol.
This protocol was only used to fake recursive protocol conformances; collapse it into _UnicodeEncoding.
1 parent 41ff058 commit 3b47b16

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

stdlib/public/core/UTFEncoding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
public protocol _UTFParser {
20-
associatedtype Encoding : _UnicodeEncoding_
20+
associatedtype Encoding : _UnicodeEncoding
2121

2222
func _parseMultipleCodeUnits() -> (isValid: Bool, bitCount: UInt8)
2323
func _bufferedScalar(bitCount: UInt8) -> Encoding.EncodedScalar

stdlib/public/core/UnicodeEncoding.swift

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
public protocol _UnicodeEncoding_ {
13+
public protocol _UnicodeEncoding {
1414
/// The basic unit of encoding
1515
associatedtype CodeUnit : UnsignedInteger, FixedWidthInteger
1616

@@ -44,12 +44,12 @@ public protocol _UnicodeEncoding_ {
4444
/// A type that can be used to parse `CodeUnits` into
4545
/// `EncodedScalar`s.
4646
associatedtype ForwardParser : Unicode.Parser
47-
// where ForwardParser.Encoding == Self
47+
where ForwardParser.Encoding == Self
4848

4949
/// A type that can be used to parse a reversed sequence of
5050
/// `CodeUnits` into `EncodedScalar`s.
5151
associatedtype ReverseParser : Unicode.Parser
52-
// where ReverseParser.Encoding == Self
52+
where ReverseParser.Encoding == Self
5353

5454
//===--------------------------------------------------------------------===//
5555
// FIXME: this requirement shouldn't be here and is mitigated by the default
@@ -60,15 +60,10 @@ public protocol _UnicodeEncoding_ {
6060
static func _isScalar(_ x: CodeUnit) -> Bool
6161
}
6262

63-
extension _UnicodeEncoding_ {
63+
extension _UnicodeEncoding {
6464
// See note on declaration of requirement, above
6565
public static func _isScalar(_ x: CodeUnit) -> Bool { return false }
66-
}
67-
68-
public protocol _UnicodeEncoding : _UnicodeEncoding_
69-
where ForwardParser.Encoding == Self, ReverseParser.Encoding == Self {}
7066

71-
extension _UnicodeEncoding_ {
7267
public static func transcode<FromEncoding : Unicode.Encoding>(
7368
_ content: FromEncoding.EncodedScalar, from _: FromEncoding.Type
7469
) -> EncodedScalar? {

stdlib/public/core/UnicodeParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extension Unicode {
4343
/// scalar values.
4444
public protocol _UnicodeParser {
4545
/// The encoding with which this parser is associated
46-
associatedtype Encoding : _UnicodeEncoding_
46+
associatedtype Encoding : _UnicodeEncoding
4747

4848
/// Constructs an instance that can be used to begin parsing `CodeUnit`s at
4949
/// any Unicode scalar boundary.

0 commit comments

Comments
 (0)