Skip to content

Commit 0a7780c

Browse files
committed
[stdlib] Various minor documentation revisions
1 parent 673d04f commit 0a7780c

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

stdlib/public/core/Builtin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ public func type<T, Metatype>(of value: T) -> Metatype {
831831
/// }
832832
/// }
833833
///
834-
/// - Important: The escapable copy of `closure` passed as `body` is only valid
834+
/// - Important: The escapable copy of `closure` passed to `body` is only valid
835835
/// during the call to `withoutActuallyEscaping(_:do:)`. It is undefined
836836
/// behavior for the escapable closure to be stored, referenced, or executed
837837
/// after the function returns.

stdlib/public/core/Collection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ public struct IndexingIterator<
499499
/// and shares the original collection's semantics.
500500
///
501501
/// The following example creates a `firstWord` constant by using the
502-
/// `prefix(where:)` method to get a slice of the `text` string.
502+
/// `prefix(while:)` method to get a slice of the `text` string.
503503
///
504504
/// let firstWord = text.prefix(while: { $0 != " " })
505505
/// print(firstWord)

stdlib/public/core/HashedCollections.swift.gyb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5439,11 +5439,10 @@ extension ${Self} {
54395439
%{
54405440
if Self == 'Set':
54415441
SubscriptingWithIndexDoc = """\
5442-
/// Used to access the members in an instance of `Set<Element>`."""
5442+
/// The position of an element in a set."""
54435443
elif Self == 'Dictionary':
54445444
SubscriptingWithIndexDoc = """\
5445-
/// Used to access the key-value pairs in an instance of
5446-
/// `Dictionary<Key, Value>`.
5445+
/// The position of a key-value pair in a dictionary.
54475446
///
54485447
/// Dictionary has two subscripting interfaces:
54495448
///

stdlib/public/core/Range.swift.gyb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -855,21 +855,22 @@ public struct PartialRangeFrom<Bound: Comparable>: RangeExpression {
855855
}
856856
}
857857

858-
/// A partial interval extending upward from a lower bound.
858+
/// A partial interval extending upward from a lower bound that forms a
859+
/// sequence of increasing values.
859860
///
860-
/// You create `PartialRangeFrom` instances by using the postfix range operator
861-
/// (postfix `...`).
861+
/// You create `CountablePartialRangeFrom` instances by using the postfix range
862+
/// operator (postfix `...`).
862863
///
863864
/// let atLeastFive = 5.0...
864865
///
865-
/// You can use a `PartialRangeFrom` instance to quickly check if a value is
866+
/// You can use a countable partial range to quickly check if a value is
866867
/// contained in a particular range of values. For example:
867868
///
868869
/// atLeastFive.contains(4.0) // false
869870
/// atLeastFive.contains(5.0) // true
870871
/// atLeastFive.contains(6.0) // true
871872
///
872-
/// You can use a `PartialRangeFrom` instance of a collection's indices to
873+
/// You can use a countable partial range of a collection's indices to
873874
/// represent the range from the partial range's lower bound up to the end of
874875
/// the collection.
875876
///
@@ -885,9 +886,8 @@ public struct PartialRangeFrom<Bound: Comparable>: RangeExpression {
885886
/// Using a Partial Range as a Sequence
886887
/// ===================================
887888
///
888-
/// You can iterate over a `PartialRangeFrom` instance using a `for`-`in` loop,
889-
/// or call any sequence method that doesn't require that the sequence is
890-
/// finite.
889+
/// You can iterate over a countable partial range using a `for`-`in` loop, or
890+
/// call any sequence method that doesn't require that the sequence is finite.
891891
///
892892
/// func isTheMagicNumber(_ x: Int) -> Bool {
893893
/// return x == 3
@@ -906,8 +906,8 @@ public struct PartialRangeFrom<Bound: Comparable>: RangeExpression {
906906
/// // "3 is the magic number!"
907907
///
908908
/// Because a `CountablePartialRangeFrom` sequence counts upward indefinitely,
909-
/// do not use one with methods such as `map(_:)`, `filter(_:)`, or
910-
/// `suffix(_:)` that read the entire sequence before returning. It is safe to
909+
/// do not use one with methods that read the entire sequence before
910+
/// returning, such as `map(_:)`, `filter(_:)`, or `suffix(_:)`. It is safe to
911911
/// use operations that put an upper limit on the number of elements they
912912
/// access, such as `prefix(_:)` or `dropFirst(_:)`, and operations that you
913913
/// can guarantee will terminate, such as passing a closure you know will

0 commit comments

Comments
 (0)