From 598bd77a03f4aef53c6d1471cc0c2a7db89e62ab Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 30 Apr 2019 09:40:07 +0100 Subject: [PATCH] [main] inline exec --- src/main/scala/net/kemitix/s3thorp/Main.scala | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/scala/net/kemitix/s3thorp/Main.scala b/src/main/scala/net/kemitix/s3thorp/Main.scala index 961f933..e7fedd4 100644 --- a/src/main/scala/net/kemitix/s3thorp/Main.scala +++ b/src/main/scala/net/kemitix/s3thorp/Main.scala @@ -6,16 +6,13 @@ import cats.syntax.all._ object Main extends IOApp { - def exec(args: List[String]): IO[ExitCode] = - for { - ec <- IO(println("S3Thorp - hashed sync for s3")).as(ExitCode.Success) - } yield ec - override def run(args: List[String]): IO[ExitCode] = - exec(args).guaranteeCase { - case Canceled => IO(println("Interrupted")) - case Error(e) => IO(println("ERROR: " + e)) - case Completed => IO(println("Done")) - } + (for { + ec <- IO(println("S3Thorp - hashed sync for s3")).as(ExitCode.Success) + } yield ec).guaranteeCase { + case Canceled => IO(println("Interrupted")) + case Error(e) => IO(println("ERROR: " + e)) + case Completed => IO(println("Done")) + } }