2 ms·
I would not say this is not idiomatic - it depends on the situation. On production code or scripts where I want to be sure (which is the case mostly), I would
by thibaut_barrere 3y ago
I would not say this is not idiomatic - it depends on the situation.
On production code or scripts where I want to be sure (which is the case mostly), I would indeed use something like:
%{status: 200, body: json} = Req.get!(".....")
And then later restructure as needed.
Sometimes it would be:
meta = json |> Map.fetch!("meta") |> Map.fetch!("description")
Or pattern matching as you did!