[stdlib] Various revisions and fixes for documentation

- Fix wording for RandomAccessCollection
- Add note about array growth to reserveCapacity(_:)
- Reformat lazy flatMap discussions
- Improve Collection symbol consistency
This commit is contained in:
Nate Cook
2016-12-14 11:11:34 -06:00
parent 907ff3678b
commit 3bc4909de8
11 changed files with 150 additions and 106 deletions

View File

@@ -17,7 +17,7 @@ extension String {
/// The index type for subscripting a string.
public typealias Index = CharacterView.Index
/// A type used to represent the number of steps between two `String.Index`
/// A type that represents the number of steps between two `String.Index`
/// values, where one value is reachable from the other.
///
/// In Swift, *reachability* refers to the ability to produce one value from
@@ -59,8 +59,8 @@ extension String {
/// print(s[i])
/// // Prints "t"
///
/// The value passed as `n` must not offset `i` beyond the `endIndex` or
/// before the `startIndex` of this collection.
/// The value passed as `n` must not offset `i` beyond `endIndex` or before
/// `startIndex` for this collection.
///
/// - Parameters:
/// - i: A valid index of the collection.
@@ -98,9 +98,9 @@ extension String {
/// print(j)
/// // Prints "nil"
///
/// The value passed as `n` must not offset `i` beyond the `endIndex` or
/// before the `startIndex` of this collection, unless the index passed as
/// `limit` prevents offsetting beyond those bounds.
/// The value passed as `n` must not offset `i` beyond `endIndex` or before
/// `startIndex` for this collection, unless the index passed as `limit`
/// prevents offsetting beyond those bounds.
///
/// - Parameters:
/// - i: A valid index of the collection.