Skip to content

Commit

Permalink
Refactor code for better readability
Browse files Browse the repository at this point in the history
Reformatted HttpResponse and AstroResponse variable declarations to improve code clarity. This change ensures the code is easier to read and maintain by adhering to consistent coding style practices.
  • Loading branch information
kousen committed Nov 15, 2024
1 parent 6c22ae5 commit 8bc1364
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ public Result fetchAndProcessData() {
.header("Accept", "application/json")
.build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());

if (response.statusCode() != 200) {
return new Result.Failure("HTTP error: " + response.statusCode());
}

AstroResponse astroResponse = objectMapper.readValue(response.body(), AstroResponse.class);
AstroResponse astroResponse =
objectMapper.readValue(response.body(), AstroResponse.class);

Map<String, List<String>> astronautsByCraft = groupAstronautsByCraft(astroResponse);

Expand Down

0 comments on commit 8bc1364

Please sign in to comment.