Move convertDurationUnit into Duration companion
This commit is contained in:
@@ -34,6 +34,10 @@ public inline class Duration internal constructor(internal val value: Double) :
|
||||
companion object {
|
||||
val ZERO: Duration = Duration(0.0)
|
||||
val INFINITE: Duration = Duration(Double.POSITIVE_INFINITY)
|
||||
|
||||
/** Converts the given time duration [value] expressed in the specified [sourceUnit] into the specified [targetUnit]. */
|
||||
public fun convert(value: Double, sourceUnit: DurationUnit, targetUnit: DurationUnit): Double =
|
||||
convertDurationUnit(value, sourceUnit, targetUnit)
|
||||
}
|
||||
|
||||
// arithmetic operators
|
||||
|
||||
@@ -46,7 +46,7 @@ public expect enum class DurationUnit {
|
||||
}
|
||||
|
||||
/** Converts the given time duration [value] expressed in the specified [sourceUnit] into the specified [targetUnit]. */
|
||||
public expect fun convertDurationUnit(value: Double, sourceUnit: DurationUnit, targetUnit: DurationUnit): Double
|
||||
internal expect fun convertDurationUnit(value: Double, sourceUnit: DurationUnit, targetUnit: DurationUnit): Double
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user