Skip to content

[stdlib] Correct actual print outputs in Concurrency files #62685

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 1 commit into from
Dec 22, 2022
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
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncCompactMapSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension AsyncSequence {
/// for await numeral in stream {
/// print(numeral, terminator: " ")
/// }
/// // Prints "I II III V"
/// // Prints "I II III V "
///
/// - Parameter transform: A mapping closure. `transform` accepts an element
/// of this sequence as its parameter and returns a transformed value of the
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncDropFirstSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension AsyncSequence {
/// for await number in Counter(howHigh: 10).dropFirst(3) {
/// print(number, terminator: " ")
/// }
/// // Prints "4 5 6 7 8 9 10"
/// // Prints "4 5 6 7 8 9 10 "
///
/// If the number of elements to drop exceeds the number of elements in the
/// sequence, the result is an empty sequence.
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncDropWhileSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extension AsyncSequence {
/// for await number in stream {
/// print(number, terminator: " ")
/// }
/// // Prints "3 4 5 6 7 8 9 10"
/// // Prints "3 4 5 6 7 8 9 10 "
///
/// After the predicate returns `false`, the sequence never executes it again,
/// and from then on the sequence passes through elements from its underlying
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncFilterSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension AsyncSequence {
/// for await number in stream {
/// print(number, terminator: " ")
/// }
/// // Prints "2 4 6 8 10"
/// // Prints "2 4 6 8 10 "
///
/// - Parameter isIncluded: A closure that takes an element of the
/// asynchronous sequence as its argument and returns a Boolean value
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncFlatMapSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension AsyncSequence {
/// for await number in stream {
/// print(number, terminator: " ")
/// }
/// // Prints "1 1 2 1 2 3 1 2 3 4 1 2 3 4 5"
/// // Prints "1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 "
///
/// - Parameter transform: A mapping closure. `transform` accepts an element
/// of this sequence as its parameter and returns an `AsyncSequence`.
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/Concurrency/AsyncIteratorProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ import Swift
///
/// At the call site, this looks like:
///
/// for await i in Counter(howHigh: 10) {
/// print(i, terminator: " ")
/// for await number in Counter(howHigh: 10) {
/// print(number, terminator: " ")
Comment on lines +60 to +61
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with BackDeployConcurrency, I renamed i to number here.

/// }
/// // Prints "1 2 3 4 5 6 7 8 9 10"
/// // Prints "1 2 3 4 5 6 7 8 9 10 "
///
/// ### End of Iteration
///
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncMapSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension AsyncSequence {
/// for await numeral in stream {
/// print(numeral, terminator: " ")
/// }
/// // Prints "I II III (unknown) V"
/// // Prints "I II III (unknown) V "
///
/// - Parameter transform: A mapping closure. `transform` accepts an element
/// of this sequence as its parameter and returns a transformed value of the
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncPrefixSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension AsyncSequence {
/// for await number in Counter(howHigh: 10).prefix(6) {
/// print(number, terminator: " ")
/// }
/// // Prints "1 2 3 4 5 6"
/// // Prints "1 2 3 4 5 6 "
///
/// If the count passed to `prefix(_:)` exceeds the number of elements in the
/// base sequence, the result contains all of the elements in the sequence.
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension AsyncSequence {
/// for try await number in stream {
/// print(number, terminator: " ")
/// }
/// // Prints "1 2 3 4 5"
/// // Prints "1 2 3 4 5 "
///
/// - Parameter predicate: A closure that takes an element as a parameter and
/// returns a Boolean value indicating whether the element should be
Expand Down
8 changes: 4 additions & 4 deletions stdlib/public/Concurrency/AsyncSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import Swift
/// over `Counter`, a custom `AsyncSequence` that produces `Int` values from
/// `1` up to a `howHigh` value:
///
/// for await i in Counter(howHigh: 10) {
/// print(i, terminator: " ")
/// for await number in Counter(howHigh: 10) {
/// print(number, terminator: " ")
Comment on lines +30 to +31
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here!

/// }
/// // Prints "1 2 3 4 5 6 7 8 9 10"
/// // Prints "1 2 3 4 5 6 7 8 9 10 "
///
/// An `AsyncSequence` doesn't generate or contain the values; it just defines
/// how you access them. Along with defining the type of values as an associated
Expand Down Expand Up @@ -69,7 +69,7 @@ import Swift
/// for await s in stream {
/// print(s, terminator: " ")
/// }
/// // Prints "Odd Even Odd Even Odd Even Odd Even Odd Even"
/// // Prints "Odd Even Odd Even Odd Even Odd Even Odd Even "
///
@available(SwiftStdlib 5.1, *)
@rethrows
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extension AsyncSequence {
/// } catch {
/// print("Error: \(error)")
/// }
/// // Prints "I II III Error: MyError()"
/// // Prints "I II III Error: MyError() "
///
/// - Parameter transform: An error-throwing mapping closure. `transform`
/// accepts an element of this sequence as its parameter and returns a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension AsyncSequence {
/// } catch {
/// print("Error: \(error)")
/// }
/// // Prints "2 4 Error: MyError()"
/// // Prints "2 4 Error: MyError() "
///
/// - Parameter isIncluded: An error-throwing closure that takes an element
/// of the asynchronous sequence as its argument and returns a Boolean value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension AsyncSequence {
/// } catch {
/// print(error)
/// }
/// // Prints "1 1 2 1 2 3 MyError()"
/// // Prints "1 1 2 1 2 3 MyError() "
///
/// - Parameter transform: An error-throwing mapping closure. `transform`
/// accepts an element of this sequence as its parameter and returns an
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Concurrency/AsyncThrowingMapSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extension AsyncSequence {
/// } catch {
/// print("Error: \(error)")
/// }
/// // Prints "I II III Error: MyError()"
/// // Prints "I II III Error: MyError() "
///
/// - Parameter transform: A mapping closure. `transform` accepts an element
/// of this sequence as its parameter and returns a transformed value of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ extension AsyncSequence {
/// } catch {
/// print("Error: \(error)")
/// }
/// // Prints "1 2 3 4 Error: MyError()"
/// // Prints "1 2 3 4 Error: MyError() "
///
/// - Parameter predicate: A error-throwing closure that takes an element of
/// the asynchronous sequence as its argument and returns a Boolean value
Expand Down