Skip to content

Commit 64c1b20

Browse files
amartini51Colleen Toporek
andcommitted
Incorporate fixes from editorial
Edits from <rdar://150071036>. Co-authored-by: Colleen Toporek <colleen_toporek@apple.com>
1 parent d6fee65 commit 64c1b20

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

TSPL.docc/LanguageGuide/Generics.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ or indeed an array for any other type that can be created in Swift.
1919
Similarly, you can create a dictionary to store values of any specified type,
2020
and there are no limitations on what that type can be.
2121

22-
## The Problem That Generics Solve
22+
## The Problem that Generics Solve
2323

2424
Here's a standard, nongeneric function called `swapTwoInts(_:_:)`,
2525
which swaps two `Int` values:
@@ -1958,17 +1958,17 @@ is a sequence of integers.
19581958
## Implicit Constraints
19591959

19601960
In addition to the constraints you write explicitly,
1961-
many places in your code
1962-
also implicitly include an constraint
1963-
that types conform to some very common protocols
1961+
many places in your generic code
1962+
also include implicit constraints
1963+
that require types to conform to some very common protocols
19641964
like [`Copyable`][].
19651965
<!-- When SE-0446 is implemented, add Escapable above -->
19661966
For information on when a protocol is implied,
19671967
see the reference for that protocol.
19681968

19691969
[`Copyable`]: https://developer.apple.com/documentation/swift/copyable
19701970

1971-
This constraint is implicit because
1971+
These constraints are implicit because
19721972
almost all types in Swift conform to these protocols,
19731973
so you specify only the exceptions.
19741974
For example, both of the following function declarations
@@ -1984,7 +1984,7 @@ require the generic type parameter `MyType` to be copyable.
19841984
In the first version, the constraint is implicit;
19851985
the second version lists the explicitly.
19861986
In most code,
1987-
types also implicitly conform to these common protocol.
1987+
types also implicitly conform to these common protocols.
19881988
For more information,
19891989
see <doc:Protocols#Implicit-Conformance-to-a-Protocol>.
19901990

TSPL.docc/LanguageGuide/OpaqueTypes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Boxed protocol types don't preserve type identity ---
2323
the value's specific type isn't known until runtime,
2424
and it can change over time as different values are stored.
2525

26-
## The Problem That Opaque Types Solve
26+
## The Problem that Opaque Types Solve
2727

2828
For example,
2929
suppose you're writing a module that draws ASCII art shapes.

TSPL.docc/LanguageGuide/Protocols.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ a nonfailable initializer or an implicitly unwrapped failable initializer.
752752
```
753753
-->
754754

755-
## Protocols That Have Only Semantic Requirements
755+
## Protocols that Have Only Semantic Requirements
756756

757757
All of the example protocols above require some methods or properties,
758758
but a protocol declaration doesn't have to include any requirements.
@@ -799,10 +799,10 @@ struct MyStruct: Copyable {
799799
extension MyStruct: BitwiseCopyable { }
800800
```
801801

802-
The code above defines a new structure
802+
The code above defines a new structure.
803803
Because `Copyable` has only semantic requirements,
804804
there isn't any code in the structure declaration to adopt the protocol.
805-
Likewise, because `BitwiseCopyable` has only semantic requirements,
805+
Similarly, because `BitwiseCopyable` has only semantic requirements,
806806
the extension that adopts that protocol has an empty body.
807807

808808
You usually don't need to write conformance to these protocols ---
@@ -1469,7 +1469,7 @@ XXX SE-0390 uses the same example but ~Copyable -- is that better?
14691469
The code above shows part of a wrapper around POSIX file descriptors.
14701470
The `FileDescriptor` structure
14711471
satisfies all of the requirements of the `Sendable` protocol,
1472-
which would normally make it sendable.
1472+
which normally makes it sendable.
14731473
However,
14741474
writing `~Sendable` suppresses this implicit conformance.
14751475
Even though file descriptors use integers

0 commit comments

Comments
 (0)