From 0931f82414c30175867267716d7baf34b7fd25e1 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 11 May 2019 06:25:47 +0100 Subject: [PATCH] [sync] remove unneeded for-comprehension --- src/main/scala/net/kemitix/s3thorp/Sync.scala | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/scala/net/kemitix/s3thorp/Sync.scala b/src/main/scala/net/kemitix/s3thorp/Sync.scala index a95421c..2e4ed8a 100644 --- a/src/main/scala/net/kemitix/s3thorp/Sync.scala +++ b/src/main/scala/net/kemitix/s3thorp/Sync.scala @@ -4,7 +4,6 @@ import java.io.File import java.time.Instant import cats.effect._ -import net.kemitix.s3thorp.Main.putStrLn import net.kemitix.s3thorp.Sync.{Bucket, LocalFile, RemoteKey} import net.kemitix.s3thorp.awssdk.S3Client @@ -20,15 +19,13 @@ class Sync(s3Client: S3Client) override def upload(localFile: LocalFile, bucket: Bucket, remoteKey: RemoteKey) = s3Client.upload(localFile, bucket, remoteKey) - def run(c: Config): IO[Unit] = for { - _ <- putStrLn(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}") - _ <- { - streamDirectoryPaths(c.source).flatMap( - enrichWithS3MetaData(c)).flatMap( - uploadRequiredFilter(c)).flatMap( - performUpload(c)).compile.drain - } - } yield () + def run(c: Config): IO[Unit] = { + println(s"Bucket: ${c.bucket}, Prefix: ${c.prefix}, Source: ${c.source}") + streamDirectoryPaths(c.source).flatMap( + enrichWithS3MetaData(c)).flatMap( + uploadRequiredFilter(c)).flatMap( + performUpload(c)).compile.drain + } }