From 2fedb4ecf07e2967aac2ef08cd47512e86fd74a3 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Tue, 4 Jun 2024 14:36:20 +0000 Subject: [PATCH] wip(growth): change from `with` to `case` --- lib/growth/indicators/download.ex | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/growth/indicators/download.ex b/lib/growth/indicators/download.ex index 96abd76..cd6779e 100644 --- a/lib/growth/indicators/download.ex +++ b/lib/growth/indicators/download.ex @@ -228,10 +228,12 @@ defmodule Growth.Indicators.Download do end def fetch!(url) do - with {:ok, %{status: 200, body: body}} <- Req.get(url) do - body - else - _ -> raise("fetch failed for url #{url}") + case Req.get(url) do + {:ok, %{status: 200, body: body}} -> + body + + _ -> + raise("fetch failed for url #{url}") end end