Corrects code that would fail due to type mismatch

I know this probably seems nit-picky since this isn't a language reference, but it seems numberOfWheels should be converted to Float when doing the math here to get tire pressure. Otherwise, I'm loving this style guide!
This commit is contained in:
Kevin deLeon 2015-06-04 08:42:03 -05:00
Родитель dec6f540b2
Коммит e102e26b2d
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -190,7 +190,7 @@ class Vehicle {
}
func maximumTotalTirePressure(pressurePerWheel: Float) -> Float {
return pressurePerWheel * numberOfWheels
return pressurePerWheel * Float(numberOfWheels)
}
}
@ -215,7 +215,7 @@ protocol Vehicle {
}
func maximumTotalTirePressure(vehicle: Vehicle, pressurePerWheel: Float) -> Float {
return pressurePerWheel * vehicle.numberOfWheels
return pressurePerWheel * Float(vehicle.numberOfWheels)
}
struct Bicycle: Vehicle {