Skip to content

Commit 1d23ca7

Browse files
authored
Merge pull request swiftlang#32556 from amartini51/release/5.3
[5.3] Minor doc fixes
2 parents 3998644 + 98399fa commit 1d23ca7

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

stdlib/public/core/CharacterProperties.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extension Character {
3232
///
3333
/// let chars: [Character] = ["a", " ", "™"]
3434
/// for ch in chars {
35-
/// print(ch, "-->", ch.properties.numericValue)
35+
/// print(ch, "-->", ch.asciiValue)
3636
/// }
3737
/// // a --> 97
3838
/// // --> 32
@@ -125,7 +125,7 @@ extension Character {
125125
///
126126
/// let chars: [Character] = ["4", "④", "万", "a"]
127127
/// for ch in chars {
128-
/// print(ch, "-->", ch.properties.numericValue)
128+
/// print(ch, "-->", ch.wholeNumberValue)
129129
/// }
130130
/// // 4 --> 4
131131
/// // ④ --> 4

stdlib/public/core/Collection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ public protocol Collection: Sequence {
491491
///
492492
/// let horseName = "Silver"
493493
/// if horseName.isEmpty {
494-
/// print("I've been through the desert on a horse with no name.")
494+
/// print("My horse has no name.")
495495
/// } else {
496496
/// print("Hi ho, \(horseName)!")
497497
/// }
@@ -1070,7 +1070,7 @@ extension Collection {
10701070
///
10711071
/// let horseName = "Silver"
10721072
/// if horseName.isEmpty {
1073-
/// print("I've been through the desert on a horse with no name.")
1073+
/// print("My horse has no name.")
10741074
/// } else {
10751075
/// print("Hi ho, \(horseName)!")
10761076
/// }

stdlib/public/core/Dictionary.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ extension Dictionary {
862862
/// let message = "Hello, Elle!"
863863
/// var letterCounts: [Character: Int] = [:]
864864
/// for letter in message {
865-
/// letterCounts[letter, defaultValue: 0] += 1
865+
/// letterCounts[letter, default: 0] += 1
866866
/// }
867867
/// // letterCounts == ["H": 1, "e": 2, "l": 4, "o": 1, ...]
868868
///

stdlib/public/core/FloatingPoint.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@
144144
/// every value of the `tempsFahrenheit` array, any NaN values cause the
145145
/// result to also be NaN, as seen in this example:
146146
///
147-
/// let badAverage = tempsFahrenheit.reduce(0.0, combine: +) / Double(tempsFahrenheit.count)
147+
/// let badAverage = tempsFahrenheit.reduce(0.0, +) / Double(tempsFahrenheit.count)
148148
/// // badAverage.isNaN == true
149149
///
150150
/// Instead, when you need an operation to have a specific numeric result,
151151
/// filter out any NaN values using the `isNaN` property.
152152
///
153153
/// let validTemps = tempsFahrenheit.filter { !$0.isNaN }
154-
/// let average = validTemps.reduce(0.0, combine: +) / Double(validTemps.count)
154+
/// let average = validTemps.reduce(0.0, +) / Double(validTemps.count)
155155
///
156156
/// Finally, report the average temperature and observation counts:
157157
///

0 commit comments

Comments
 (0)