Skip to content

[stdlib] Minor documentation revisions #20045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stdlib/public/core/Bool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ extension Bool {
/// Use this method to toggle a Boolean value from `true` to `false` or from
/// `false` to `true`.
///
/// var bools = [true, false]
/// var bools = [true, false]
///
/// bools[0].toggle()
/// // bools == [false, false]
/// bools[0].toggle()
/// // bools == [false, false]
@inlinable
public mutating func toggle() {
self = !self
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Builtin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ func _trueAfterDiagnostics() -> Builtin.Int1 {
/// particularly when the dynamic type is different from the static type. The
/// *static type* of a value is the known, compile-time type of the value. The
/// *dynamic type* of a value is the value's actual type at run-time, which
/// can be nested inside its concrete type.
/// can be a subtype of its concrete type.
///
/// In the following code, the `count` variable has the same static and dynamic
/// type: `Int`. When `count` is passed to the `printInfo(_:)` function,
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Codable.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ public enum DecodingError : Error {
/// for debugging.
case typeMismatch(Any.Type, Context)

/// An indication that a nonoptional value of the given type was expected,
/// An indication that a non-optional value of the given type was expected,
/// but a null value was found.
///
/// As associated values, this case contains the attempted type and context
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Collection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public protocol Collection: Sequence where SubSequence: Collection {

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

/// The first element of the collection.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/Dictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
///
/// Note that in this example, `imagePaths` is subscripted using a dictionary
/// index. Unlike the key-based subscript, the index-based subscript returns
/// the corresponding key-value pair as a nonoptional tuple.
/// the corresponding key-value pair as a non-optional tuple.
///
/// print(imagePaths[glyphIndex!])
/// // Prints "("star", "/glyphs/star.png")"
Expand Down Expand Up @@ -967,7 +967,7 @@ extension Dictionary {
/// Returns a new dictionary containing only the key-value pairs that have
/// non-`nil` values as the result from the transform by the given closure.
///
/// Use this method to receive a dictionary of nonoptional values when your
/// Use this method to receive a dictionary of non-optional values when your
/// transformation can produce an optional value.
///
/// In this example, note the difference in the result of using `mapValues`
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/FlatMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension LazySequenceProtocol {
/// Returns the non-`nil` results of mapping the given transformation over
/// this sequence.
///
/// Use this method to receive a sequence of nonoptional values when your
/// Use this method to receive a sequence of non-optional values when your
/// transformation produces an optional value.
///
/// - Parameter transform: A closure that accepts an element of this sequence
Expand Down Expand Up @@ -73,7 +73,7 @@ extension LazyCollectionProtocol {
/// Returns the non-`nil` results of mapping the given transformation over
/// this collection.
///
/// Use this method to receive a collection of nonoptional values when your
/// Use this method to receive a collection of non-optional values when your
/// transformation produces an optional value.
///
/// - Parameter transform: A closure that accepts an element of this
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/MigrationSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ extension LazySequenceProtocol {
/// Returns the non-`nil` results of mapping the given transformation over
/// this sequence.
///
/// Use this method to receive a sequence of nonoptional values when your
/// Use this method to receive a sequence of non-optional values when your
/// transformation produces an optional value.
///
/// - Parameter transform: A closure that accepts an element of this sequence
Expand Down Expand Up @@ -413,7 +413,7 @@ extension LazyCollectionProtocol {
/// Returns the non-`nil` results of mapping the given transformation over
/// this collection.
///
/// Use this method to receive a collection of nonoptional values when your
/// Use this method to receive a collection of non-optional values when your
/// transformation produces an optional value.
///
/// - Parameter transform: A closure that accepts an element of this
Expand Down
10 changes: 5 additions & 5 deletions stdlib/public/core/Optional.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public enum Optional<Wrapped> : ExpressibleByNilLiteral {
/// Evaluates the given closure when this `Optional` instance is not `nil`,
/// passing the unwrapped value as a parameter.
///
/// Use the `map` method with a closure that returns a nonoptional value.
/// Use the `map` method with a closure that returns a non-optional value.
/// This example performs an arithmetic operation on an
/// optional integer.
///
Expand Down Expand Up @@ -328,8 +328,8 @@ extension Optional : Equatable where Wrapped : Equatable {
/// }
/// // Prints "The two groups start the same."
///
/// You can also use this operator to compare a nonoptional value to an
/// optional that wraps the same type. The nonoptional value is wrapped as an
/// You can also use this operator to compare a non-optional value to an
/// optional that wraps the same type. The non-optional value is wrapped as an
/// optional before the comparison is made. In the following example, the
/// `numberToMatch` constant is wrapped as an optional before comparing to the
/// optional `numberFromString`:
Expand Down Expand Up @@ -570,7 +570,7 @@ extension Optional {
///
/// A nil-coalescing operation unwraps the left-hand side if it has a value, or
/// it returns the right-hand side as a default. The result of this operation
/// will have the nonoptional type of the left-hand side's `Wrapped` type.
/// will have the non-optional type of the left-hand side's `Wrapped` type.
///
/// This operator uses short-circuit evaluation: `optional` is checked first,
/// and `defaultValue` is evaluated only if `optional` is `nil`. For example:
Expand Down Expand Up @@ -643,7 +643,7 @@ public func ?? <T>(optional: T?, defaultValue: @autoclosure () throws -> T)
///
/// If `userPrefs[greetingKey]` has a value, that value is assigned to
/// `greeting`. If not, any value in `defaults[greetingKey]` will succeed, and
/// if not that, `greeting` will be set to the nonoptional default value,
/// if not that, `greeting` will be set to the non-optional default value,
/// `"Greetings!"`.
///
/// - Parameters:
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/SequenceAlgorithms.swift
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ extension Sequence {
/// Returns an array containing the non-`nil` results of calling the given
/// transformation with each element of this sequence.
///
/// Use this method to receive an array of nonoptional values when your
/// Use this method to receive an array of non-optional values when your
/// transformation produces an optional value.
///
/// In this example, note the difference in the result of using `map` and
Expand Down