Skip to content

Commit dfb01b6

Browse files
authored
[stdlib] Minor documentation revisions (#20045)
* [stdlib] Minor documentation revisions * [docs] Convert 'nonoptional' to 'non-optional' We're switching to 'non-optional' across the board, as the unhyphenated form is too easy to read as 'no-noptional'.
1 parent fcdca5d commit dfb01b6

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

stdlib/public/core/Bool.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ extension Bool {
343343
/// Use this method to toggle a Boolean value from `true` to `false` or from
344344
/// `false` to `true`.
345345
///
346-
/// var bools = [true, false]
346+
/// var bools = [true, false]
347347
///
348-
/// bools[0].toggle()
349-
/// // bools == [false, false]
348+
/// bools[0].toggle()
349+
/// // bools == [false, false]
350350
@inlinable
351351
public mutating func toggle() {
352352
self = !self

stdlib/public/core/Builtin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ func _trueAfterDiagnostics() -> Builtin.Int1 {
735735
/// particularly when the dynamic type is different from the static type. The
736736
/// *static type* of a value is the known, compile-time type of the value. The
737737
/// *dynamic type* of a value is the value's actual type at run-time, which
738-
/// can be nested inside its concrete type.
738+
/// can be a subtype of its concrete type.
739739
///
740740
/// In the following code, the `count` variable has the same static and dynamic
741741
/// type: `Int`. When `count` is passed to the `printInfo(_:)` function,

stdlib/public/core/Codable.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ public enum DecodingError : Error {
12021202
/// for debugging.
12031203
case typeMismatch(Any.Type, Context)
12041204

1205-
/// An indication that a nonoptional value of the given type was expected,
1205+
/// An indication that a non-optional value of the given type was expected,
12061206
/// but a null value was found.
12071207
///
12081208
/// As associated values, this case contains the attempted type and context

stdlib/public/core/Collection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ public protocol Collection: Sequence where SubSequence: Collection {
634634

635635
// FIXME(move-only types): `first` might not be implementable by collections
636636
// with move-only elements, since they would need to be able to somehow form
637-
// a temporary `Optional<Element>` value from a nonoptional Element without
637+
// a temporary `Optional<Element>` value from a non-optional Element without
638638
// modifying the collection.
639639

640640
/// The first element of the collection.

stdlib/public/core/Dictionary.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348
///
349349
/// Note that in this example, `imagePaths` is subscripted using a dictionary
350350
/// index. Unlike the key-based subscript, the index-based subscript returns
351-
/// the corresponding key-value pair as a nonoptional tuple.
351+
/// the corresponding key-value pair as a non-optional tuple.
352352
///
353353
/// print(imagePaths[glyphIndex!])
354354
/// // Prints "("star", "/glyphs/star.png")"
@@ -967,7 +967,7 @@ extension Dictionary {
967967
/// Returns a new dictionary containing only the key-value pairs that have
968968
/// non-`nil` values as the result from the transform by the given closure.
969969
///
970-
/// Use this method to receive a dictionary of nonoptional values when your
970+
/// Use this method to receive a dictionary of non-optional values when your
971971
/// transformation can produce an optional value.
972972
///
973973
/// In this example, note the difference in the result of using `mapValues`

stdlib/public/core/FlatMap.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extension LazySequenceProtocol {
3131
/// Returns the non-`nil` results of mapping the given transformation over
3232
/// this sequence.
3333
///
34-
/// Use this method to receive a sequence of nonoptional values when your
34+
/// Use this method to receive a sequence of non-optional values when your
3535
/// transformation produces an optional value.
3636
///
3737
/// - Parameter transform: A closure that accepts an element of this sequence
@@ -73,7 +73,7 @@ extension LazyCollectionProtocol {
7373
/// Returns the non-`nil` results of mapping the given transformation over
7474
/// this collection.
7575
///
76-
/// Use this method to receive a collection of nonoptional values when your
76+
/// Use this method to receive a collection of non-optional values when your
7777
/// transformation produces an optional value.
7878
///
7979
/// - Parameter transform: A closure that accepts an element of this

stdlib/public/core/MigrationSupport.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ extension LazySequenceProtocol {
337337
/// Returns the non-`nil` results of mapping the given transformation over
338338
/// this sequence.
339339
///
340-
/// Use this method to receive a sequence of nonoptional values when your
340+
/// Use this method to receive a sequence of non-optional values when your
341341
/// transformation produces an optional value.
342342
///
343343
/// - Parameter transform: A closure that accepts an element of this sequence
@@ -413,7 +413,7 @@ extension LazyCollectionProtocol {
413413
/// Returns the non-`nil` results of mapping the given transformation over
414414
/// this collection.
415415
///
416-
/// Use this method to receive a collection of nonoptional values when your
416+
/// Use this method to receive a collection of non-optional values when your
417417
/// transformation produces an optional value.
418418
///
419419
/// - Parameter transform: A closure that accepts an element of this

stdlib/public/core/Optional.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public enum Optional<Wrapped> : ExpressibleByNilLiteral {
139139
/// Evaluates the given closure when this `Optional` instance is not `nil`,
140140
/// passing the unwrapped value as a parameter.
141141
///
142-
/// Use the `map` method with a closure that returns a nonoptional value.
142+
/// Use the `map` method with a closure that returns a non-optional value.
143143
/// This example performs an arithmetic operation on an
144144
/// optional integer.
145145
///
@@ -328,8 +328,8 @@ extension Optional : Equatable where Wrapped : Equatable {
328328
/// }
329329
/// // Prints "The two groups start the same."
330330
///
331-
/// You can also use this operator to compare a nonoptional value to an
332-
/// optional that wraps the same type. The nonoptional value is wrapped as an
331+
/// You can also use this operator to compare a non-optional value to an
332+
/// optional that wraps the same type. The non-optional value is wrapped as an
333333
/// optional before the comparison is made. In the following example, the
334334
/// `numberToMatch` constant is wrapped as an optional before comparing to the
335335
/// optional `numberFromString`:
@@ -570,7 +570,7 @@ extension Optional {
570570
///
571571
/// A nil-coalescing operation unwraps the left-hand side if it has a value, or
572572
/// it returns the right-hand side as a default. The result of this operation
573-
/// will have the nonoptional type of the left-hand side's `Wrapped` type.
573+
/// will have the non-optional type of the left-hand side's `Wrapped` type.
574574
///
575575
/// This operator uses short-circuit evaluation: `optional` is checked first,
576576
/// and `defaultValue` is evaluated only if `optional` is `nil`. For example:
@@ -643,7 +643,7 @@ public func ?? <T>(optional: T?, defaultValue: @autoclosure () throws -> T)
643643
///
644644
/// If `userPrefs[greetingKey]` has a value, that value is assigned to
645645
/// `greeting`. If not, any value in `defaults[greetingKey]` will succeed, and
646-
/// if not that, `greeting` will be set to the nonoptional default value,
646+
/// if not that, `greeting` will be set to the non-optional default value,
647647
/// `"Greetings!"`.
648648
///
649649
/// - Parameters:

stdlib/public/core/SequenceAlgorithms.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ extension Sequence {
810810
/// Returns an array containing the non-`nil` results of calling the given
811811
/// transformation with each element of this sequence.
812812
///
813-
/// Use this method to receive an array of nonoptional values when your
813+
/// Use this method to receive an array of non-optional values when your
814814
/// transformation produces an optional value.
815815
///
816816
/// In this example, note the difference in the result of using `map` and

0 commit comments

Comments
 (0)