Skip to content

Commit

Permalink
Upgrade scalalib to 11.3.0
Browse files Browse the repository at this point in the history
Fix timestamper by renaming method.
  • Loading branch information
isaacl committed Oct 15, 2024
1 parent 7b9f221 commit 1b20548
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inThisBuild(
)
)

val scalalibVersion = "11.2.9"
val scalalibVersion = "11.3.0"

val commonSettings = Seq(
scalacOptions := Seq(
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/scala/Timestamp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package chess
opaque type Timestamp = Long
object Timestamp extends OpaqueLong[Timestamp]:
extension (t: Timestamp)
def -(o: Timestamp): Centis = Centis.ofMillis(t - o.value)
def +(o: Centis): Timestamp = Timestamp(t + o.millis)
def --(o: Timestamp): Centis = Centis.ofMillis(t - o.value)
def +(o: Centis): Timestamp = Timestamp(t + o.millis)

trait Timestamper:
def now: Timestamp
def toNow(ts: Timestamp) = now - ts
def toNow(ts: Timestamp) = now -- ts

private[chess] object RealTimestamper extends Timestamper:
def now = Timestamp(System.currentTimeMillis)

0 comments on commit 1b20548

Please sign in to comment.