diff --git a/lib/asciinema/file_store.ex b/lib/asciinema/file_store.ex index 32ea779..0b0baac 100644 --- a/lib/asciinema/file_store.ex +++ b/lib/asciinema/file_store.ex @@ -19,9 +19,8 @@ defmodule Asciinema.FileStore do @behaviour Asciinema.FileStore def download_file(store_path, local_path) do - case open_file(store_path, &(:file.copy(&1, local_path))) do - {:ok, {:ok, _}} -> :ok - otherwise -> otherwise + with {:ok, {:ok, _}} <- open_file(store_path, &(:file.copy(&1, local_path))) do + :ok end end end diff --git a/lib/asciinema/file_store/cached.ex b/lib/asciinema/file_store/cached.ex index fd92598..d793a06 100644 --- a/lib/asciinema/file_store/cached.ex +++ b/lib/asciinema/file_store/cached.ex @@ -6,8 +6,6 @@ defmodule Asciinema.FileStore.Cached do with :ok <- remote_store().put_file(dst_path, src_local_path, content_type, compress), :ok <- cache_store().put_file(dst_path, src_local_path, content_type, compress) do :ok - else - otherwise -> otherwise end end @@ -25,8 +23,6 @@ defmodule Asciinema.FileStore.Cached do :ok <- cache_store().put_file(path, tmp_path, MIME.path(path)), :ok <- File.rm(tmp_path) do cache_store().open_file(path, function) - else - otherwise -> otherwise end otherwise -> otherwise diff --git a/lib/asciinema/file_store/s3.ex b/lib/asciinema/file_store/s3.ex index 8cef4fb..e86f3d4 100644 --- a/lib/asciinema/file_store/s3.ex +++ b/lib/asciinema/file_store/s3.ex @@ -14,9 +14,8 @@ defmodule Asciinema.FileStore.S3 do {body, opts} end - case make_request(S3.put_object(bucket(), base_path() <> dst_path, body, opts)) do - {:ok, _} -> :ok - otherwise -> otherwise + with {:ok, _} <- make_request(S3.put_object(bucket(), base_path() <> dst_path, body, opts)) do + :ok end end