Skip to content

Commit a130dfc

Browse files
committed
Manually correct some incorrect bulk changes.
1 parent 28a4aaf commit a130dfc

File tree

8 files changed

+83
-83
lines changed

8 files changed

+83
-83
lines changed

Sources/TSPL/TSPL.docc/LanguageGuide/Enumerations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,11 +816,11 @@ For example, here's a function that evaluates an arithmetic expression:
816816
func evaluate(_ expression: ArithmeticExpression) -> Int {
817817
switch expression {
818818
case let .number(value):
819-
return value
819+
return value
820820
case let .addition(left, right):
821-
return evaluate(left) + evaluate(right)
821+
return evaluate(left) + evaluate(right)
822822
case let .multiplication(left, right):
823-
return evaluate(left) * evaluate(right)
823+
return evaluate(left) * evaluate(right)
824824
}
825825
}
826826

Sources/TSPL/TSPL.docc/LanguageGuide/ErrorHandling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,15 @@ class VendingMachine {
214214

215215
func vend(itemNamed name: String) throws {
216216
guard let item = inventory[name] else {
217-
throw VendingMachineError.invalidSelection
217+
throw VendingMachineError.invalidSelection
218218
}
219219

220220
guard item.count > 0 else {
221-
throw VendingMachineError.outOfStock
221+
throw VendingMachineError.outOfStock
222222
}
223223

224224
guard item.price <= coinsDeposited else {
225-
throw VendingMachineError.insufficientFunds(coinsNeeded: item.price - coinsDeposited)
225+
throw VendingMachineError.insufficientFunds(coinsNeeded: item.price - coinsDeposited)
226226
}
227227

228228
coinsDeposited -= item.price

Sources/TSPL/TSPL.docc/LanguageGuide/Generics.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ extension Stack: SuffixableContainer {
11581158
func suffix(_ size: Int) -> Stack {
11591159
var result = Stack()
11601160
for index in (count-size)..<count {
1161-
result.append(self[index])
1161+
result.append(self[index])
11621162
}
11631163
return result
11641164
}
@@ -1215,7 +1215,7 @@ extension IntStack: SuffixableContainer {
12151215
func suffix(_ size: Int) -> Stack<Int> {
12161216
var result = Stack<Int>()
12171217
for index in (count-size)..<count {
1218-
result.append(self[index])
1218+
result.append(self[index])
12191219
}
12201220
return result
12211221
}
@@ -1436,7 +1436,7 @@ to add an `isTop(_:)` method.
14361436
extension Stack where Element: Equatable {
14371437
func isTop(_ item: Element) -> Bool {
14381438
guard let topItem = items.last else {
1439-
return false
1439+
return false
14401440
}
14411441
return topItem == item
14421442
}
@@ -1601,7 +1601,7 @@ extension Container where Item == Double {
16011601
func average() -> Double {
16021602
var sum = 0.0
16031603
for index in 0..<count {
1604-
sum += self[index]
1604+
sum += self[index]
16051605
}
16061606
return sum / Double(count)
16071607
}
@@ -1666,7 +1666,7 @@ extension Container {
16661666
func average() -> Double where Item == Int {
16671667
var sum = 0.0
16681668
for index in 0..<count {
1669-
sum += Double(self[index])
1669+
sum += Double(self[index])
16701670
}
16711671
return sum / Double(count)
16721672
}
@@ -1723,7 +1723,7 @@ extension Container where Item == Int {
17231723
func average() -> Double {
17241724
var sum = 0.0
17251725
for index in 0..<count {
1726-
sum += Double(self[index])
1726+
sum += Double(self[index])
17271727
}
17281728
return sum / Double(count)
17291729
}
@@ -1911,10 +1911,10 @@ For example:
19111911
```swift
19121912
extension Container {
19131913
subscript<Indices: Sequence>(indices: Indices) -> [Item]
1914-
where Indices.Iterator.Element == Int {
1914+
where Indices.Iterator.Element == Int {
19151915
var result: [Item] = []
19161916
for index in indices {
1917-
result.append(self[index])
1917+
result.append(self[index])
19181918
}
19191919
return result
19201920
}

Sources/TSPL/TSPL.docc/LanguageGuide/Properties.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ struct CompactRect {
511511
var center: Point {
512512
get {
513513
Point(x: origin.x + (size.width / 2),
514-
y: origin.y + (size.height / 2))
514+
y: origin.y + (size.height / 2))
515515
}
516516
set {
517517
origin.x = newValue.x - (size.width / 2)
@@ -1484,13 +1484,13 @@ struct SmallNumber {
14841484
var wrappedValue: Int {
14851485
get { return number }
14861486
set {
1487-
if newValue > 12 {
1487+
if newValue > 12 {
14881488
number = 12
14891489
projectedValue = true
1490-
} else {
1490+
} else {
14911491
number = newValue
14921492
projectedValue = false
1493-
}
1493+
}
14941494
}
14951495
}
14961496

@@ -1591,10 +1591,10 @@ struct SizedRectangle {
15911591

15921592
mutating func resize(to size: Size) -> Bool {
15931593
switch size {
1594-
case .small:
1594+
case .small:
15951595
height = 10
15961596
width = 20
1597-
case .large:
1597+
case .large:
15981598
height = 100
15991599
width = 100
16001600
}

Sources/TSPL/TSPL.docc/LanguageGuide/Protocols.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class LinearCongruentialGenerator: RandomNumberGenerator {
344344
let c = 29573.0
345345
func random() -> Double {
346346
lastRandom = ((lastRandom * a + c)
347-
.truncatingRemainder(dividingBy:m))
347+
.truncatingRemainder(dividingBy:m))
348348
return lastRandom / m
349349
}
350350
}
@@ -2632,9 +2632,9 @@ you can use the `==` and `!=` operators to check for equality and inequality bet
26322632
extension Collection where Element: Equatable {
26332633
func allEqual() -> Bool {
26342634
for element in self {
2635-
if element != self.first {
2635+
if element != self.first {
26362636
return false
2637-
}
2637+
}
26382638
}
26392639
return true
26402640
}

Sources/TSPL/TSPL.docc/LanguageGuide/TheBasics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ if let firstNumber = Int("4"), let secondNumber = Int("42"), firstNumber < secon
15481548
if let firstNumber = Int("4") {
15491549
if let secondNumber = Int("42") {
15501550
if firstNumber < secondNumber && secondNumber < 100 {
1551-
print("\(firstNumber) < \(secondNumber) < 100")
1551+
print("\(firstNumber) < \(secondNumber) < 100")
15521552
}
15531553
}
15541554
}

0 commit comments

Comments
 (0)