From 1221fc85e820f48b6d19891b392deb0a5ee51372 Mon Sep 17 00:00:00 2001 From: Pat Garrity Date: Tue, 10 Sep 2024 21:35:36 -0500 Subject: [PATCH] Run pre-commit. --- .../gs/timing/v0/MonotonicProvider.scala | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/main/scala/gs/timing/v0/MonotonicProvider.scala b/src/main/scala/gs/timing/v0/MonotonicProvider.scala index d5ea13c..193e60a 100644 --- a/src/main/scala/gs/timing/v0/MonotonicProvider.scala +++ b/src/main/scala/gs/timing/v0/MonotonicProvider.scala @@ -75,42 +75,40 @@ object MonotonicProvider: final class SystemProvider[F[_]: Sync] extends MonotonicProvider[F]: override def monotonic(): F[Long] = Sync[F].delay(System.nanoTime()) - /** - * Manual implementation of the [[MonotonicProvider]] that allows the caller - * to directly increment/set a tick count, where each tick corresponds to one - * nanosecond of elapsed time. - * - * Use `ManualTickProvider.initialize[F]` to instantiate this class: - * - * {{{ - * val program: IO[ManualTickProvider[IO]] = - * ManualTickProvider.initialize[IO] - * }}} - */ + /** Manual implementation of the [[MonotonicProvider]] that allows the caller + * to directly increment/set a tick count, where each tick corresponds to one + * nanosecond of elapsed time. + * + * Use `ManualTickProvider.initialize[F]` to instantiate this class: + * + * {{{ + * val program: IO[ManualTickProvider[IO]] = + * ManualTickProvider.initialize[IO] + * }}} + */ final class ManualTickProvider[F[_]: Sync] private ( ticks: Ref[F, Long] ) extends MonotonicProvider[F]: - /** - * @return The current tick count. - */ + /** @return + * The current tick count. + */ override def monotonic(): F[Long] = ticks.get - /** - * Increment the tick count by 1. - */ + /** Increment the tick count by 1. + */ def tick(): F[Unit] = ticks.update(_ + 1) - /** - * Set the tick count to a specific value. - * - * @param newTickCount The new tick count value. - * @return Side-effect. - */ + /** Set the tick count to a specific value. + * + * @param newTickCount + * The new tick count value. + * @return + * Side-effect. + */ def set(newTickCount: Long): F[Unit] = ticks.set(newTickCount) - /** - * Reset the tick count to 0. - */ + /** Reset the tick count to 0. + */ def reset(): F[Unit] = ticks.set(0) object ManualTickProvider: