Skip to content

Commit ef4027f

Browse files
committed
Remove warnings.
1 parent a3fbf17 commit ef4027f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

time-android/src/main/kotlin/com/kizitonwose/timeandroid/AndroidExtensions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@file:Suppress("unused")
12
package com.kizitonwose.timeandroid
23

34
import android.os.Handler

time/src/main/kotlin/com/kizitonwose/time/Extensions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@file:Suppress("unused")
12
package com.kizitonwose.time
23

34
import java.util.*

time/src/main/kotlin/com/kizitonwose/time/Time.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.kizitonwose.time
22

33
import java.io.Serializable
4+
import java.util.*
5+
import kotlin.math.roundToLong
46

57
/**
68
* Created by Kizito Nwose on 14/10/2017
@@ -27,7 +29,7 @@ class Interval<out T : TimeUnit>(value: Number, factory: () -> T) : Serializable
2729

2830
val value = value.toDouble()
2931

30-
val longValue = Math.round(this.value)
32+
val longValue = this.value.roundToLong()
3133

3234
val inDays: Interval<Day>
3335
get() = converted()
@@ -90,7 +92,7 @@ class Interval<out T : TimeUnit>(value: Number, factory: () -> T) : Serializable
9092
override fun hashCode() = inMilliseconds.value.hashCode()
9193

9294
override fun toString(): String {
93-
val unitString = unit::class.java.simpleName.toLowerCase()
95+
val unitString = unit::class.java.simpleName.toLowerCase(Locale.ENGLISH)
9496
val isWhole = value % 1 == 0.0
9597
return (if (isWhole) longValue.toString() else value.toString())
9698
.plus(" ")

0 commit comments

Comments
 (0)