Skip to content

Commit 310e4e1

Browse files
committed
Fix a few typos within the documentation
Fixes more typos Also states that the range for floating points is from 0 to 1 inclusive
1 parent 7ca2f1c commit 310e4e1

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

stdlib/public/core/Collection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ public protocol Collection : Sequence
784784
/// Returns a shuffled version of this collection.
785785
///
786786
/// - Parameter generator: The random number generator to use when shuffling
787-
/// the collection. This parameter is not need as the default implementation
787+
/// the collection. This parameter is not needed as the default implementation
788788
/// of `Collection` uses the default random source in the standard library.
789789
/// - Returns: A new array containing a shuffled version of this collection's
790790
/// elements.
@@ -1003,7 +1003,7 @@ extension Collection {
10031003
/// Returns a shuffled version of this collection.
10041004
///
10051005
/// - Parameter generator: The random number generator to use when shuffling
1006-
/// the collection. This parameter is not need as the default implementation
1006+
/// the collection. This parameter is not needed as the default implementation
10071007
/// of `Collection` uses the default random source in the standard library.
10081008
/// - Returns: A new array containing a shuffled version of this collection's
10091009
/// elements.

stdlib/public/core/FloatingPoint.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2106,7 +2106,7 @@ extension BinaryFloatingPoint {
21062106
/// - Returns: A random representation of this floating point conforming to
21072107
/// `Randomizable`
21082108
///
2109-
/// The range of this random floating point is from 0 to 1
2109+
/// The range of this random floating point is from 0 to 1 inclusive
21102110
@_inlineable
21112111
public static func random(using generator: RandomGenerator) -> Self {
21122112
let random = generator.next(UInt64.self)

stdlib/public/core/MutableCollection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public protocol MutableCollection : Collection
162162
/// Shuffles the current collection
163163
///
164164
/// - Parameter generator: The random number generator to use when shuffling
165-
/// the collection. This parameter is not need as the default implementation
165+
/// the collection. This parameter is not needed as the default implementation
166166
/// of `Collection` uses the default random source in the standard library.
167167
mutating func shuffle(using generator: RandomGenerator)
168168

@@ -237,7 +237,7 @@ extension MutableCollection {
237237
/// Shuffles the current collection
238238
///
239239
/// - Parameter generator: The random number generator to use when shuffling
240-
/// the collection. This parameter is not need as the default implementation
240+
/// the collection. This parameter is not needed as the default implementation
241241
/// of `Collection` uses the default random source in the standard library.
242242
@_inlineable
243243
public mutating func shuffle(

stdlib/public/core/Random.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ import SwiftShims
2929
/// `FixedWidthInteger`. They must also be able to constrict that number down
3030
/// to an upperBound.
3131
///
32-
/// - Note: It should be worth noting that types that implement RandomGenerator
33-
/// should have a decent amount of documentation that clearly conveys whether
34-
/// or not the generator produces cryptographically-secure numbers or
35-
/// deterministically generated numbers.
32+
/// - Note: Types that implement RandomGenerator should have a decent amount of
33+
/// documentation that clearly conveys whether or not the generator produces
34+
/// cryptographically secure numbers or deterministically generated numbers.
3635
public protocol RandomGenerator {
3736
/// Produces the next randomly generated number
3837
///
@@ -64,7 +63,7 @@ public protocol RandomGenerator {
6463
/// let random = Int.random
6564
/// let randomToTen = (0 ... 10).random
6665
///
67-
/// - Note: The default implementation of randomness is cryptographically-secure.
66+
/// - Note: The default implementation of randomness is cryptographically secure.
6867
/// It utilizes arc4random on newer versions of macOS, iOS, etc. On older
6968
/// versions of these operating systems it uses /dev/urandom and SecRandomCopyBytes
7069
/// on iOS. For Linux, it tries to use the getrandom(2) system call on newer

stdlib/public/core/RandomAccessCollection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public protocol RandomAccessCollection : BidirectionalCollection
117117
///
118118
/// - Parameter generator: The random number generator to use when getting
119119
/// a random element.
120-
/// - Returns: A random random element this collection.
120+
/// - Returns: A random element this collection.
121121
///
122122
/// A good example of this is getting a random number from 1 to 10:
123123
///
@@ -234,7 +234,7 @@ extension RandomAccessCollection {
234234
///
235235
/// - Parameter generator: The random number generator to use when getting
236236
/// a random element.
237-
/// - Returns: A random random element this collection.
237+
/// - Returns: A random element this collection.
238238
///
239239
/// A good example of this is getting a random number from 1 to 10:
240240
///

0 commit comments

Comments
 (0)