From 0941e7c158a455057f42bdc5264719c0ee4e3785 Mon Sep 17 00:00:00 2001 From: Scala Steward <43047562+scala-steward@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:26:09 +0200 Subject: [PATCH] Update scalafmt-core to 3.8.3 (#395) * Update scalafmt-core to 3.8.3 * Reformat with scalafmt 3.8.3 Executed command: scalafmt --non-interactive * Add 'Reformat with scalafmt 3.8.3' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 ++ .scalafmt.conf | 2 +- .../src/main/scala/colibri/Observable.scala | 48 +++++++++---------- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index acc79ad1..4abf9b0e 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -12,3 +12,6 @@ e41ea66e8238a2e1e924f3845d923c5911a8f29a # Scala Steward: Reformat with scalafmt 3.7.17 8bde3f01a9da6f1e81c9c73378c777fa85393280 + +# Scala Steward: Reformat with scalafmt 3.8.3 +43ad6cc42bfdcd3ae2131e47dfb1c70405d103da diff --git a/.scalafmt.conf b/.scalafmt.conf index 8b6739f1..3ba7bcbe 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,5 +1,5 @@ runner.dialect = scala213 -version = "3.8.2" +version = "3.8.3" maxColumn = 140 trailingCommas = always align.preset = most diff --git a/colibri/src/main/scala/colibri/Observable.scala b/colibri/src/main/scala/colibri/Observable.scala index 53d4d5c3..9fd34130 100644 --- a/colibri/src/main/scala/colibri/Observable.scala +++ b/colibri/src/main/scala/colibri/Observable.scala @@ -1318,36 +1318,36 @@ object Observable { @inline def bufferTimed[Col[a] <: Iterable[a]](duration: FiniteDuration)(implicit factory: Factory[A, Col[A]]): Observable[Col[A]] = bufferTimedMillis( - duration.toMillis.toInt, - ) + duration.toMillis.toInt, + ) def bufferTimedMillis[Col[a] <: Iterable[a]](duration: Int)(implicit factory: Factory[A, Col[A]]): Observable[Col[A]] = new Observable[Col[A]] { - def unsafeSubscribe(sink: Observer[Col[A]]): Cancelable = { - var isCancel = false - var builder = factory.newBuilder + def unsafeSubscribe(sink: Observer[Col[A]]): Cancelable = { + var isCancel = false + var builder = factory.newBuilder - def send(): Unit = { - sink.unsafeOnNext(builder.result()) - builder = factory.newBuilder - } + def send(): Unit = { + sink.unsafeOnNext(builder.result()) + builder = factory.newBuilder + } - val intervalId = timers.setInterval(duration.toDouble) { if (!isCancel) send() } + val intervalId = timers.setInterval(duration.toDouble) { if (!isCancel) send() } - Cancelable.composite( - Cancelable { () => - isCancel = true - timers.clearInterval(intervalId) - }, - source.unsafeSubscribe( - Observer.createUnrecovered( - value => builder += value, - sink.unsafeOnError, + Cancelable.composite( + Cancelable { () => + isCancel = true + timers.clearInterval(intervalId) + }, + source.unsafeSubscribe( + Observer.createUnrecovered( + value => builder += value, + sink.unsafeOnError, + ), ), - ), - ) + ) + } } - } def evalOn(ec: ExecutionContext): Observable[A] = new Observable[A] { def unsafeSubscribe(sink: Observer[A]): Cancelable = { @@ -1474,8 +1474,8 @@ object Observable { def foldAllF[F[_]: Async, Col[a] <: Iterable[a]](implicit factory: Factory[A, Col[A]]): F[Col[A]] = foldF(factory.newBuilder) { (buff, next) => - buff += next - buff + buff += next + buff }.map(_.result()) def foldAllIO[Col[a] <: Iterable[a]](implicit factory: Factory[A, Col[A]]): IO[Col[A]] = foldAllF[IO, Col] def foldAll[Col[a] <: Iterable[a]](implicit factory: Factory[A, Col[A]]): Observable[Col[A]] = Observable.fromEffect(foldAllIO[Col])