clean code with clippy
Some checks are pending
CI/CD Pipeline / test (push) Waiting to run
CI/CD Pipeline / deploy-staging (push) Blocked by required conditions
CI/CD Pipeline / deploy-main (push) Blocked by required conditions

This commit is contained in:
2024-05-22 00:13:23 +02:00
parent 6b911f242a
commit 40f97f18a9
11 changed files with 151 additions and 124 deletions

View File

@ -103,18 +103,16 @@ fn fetch(api_key: &str) -> Result<Data, String> {
let data: Result<Data, _> = response.into_json();
if let Ok(data) = data {
return Ok(data);
Ok(data)
} else {
return Err(format!(
Err(format!(
"Failed to parse the json received by {url}: {}",
data.err().unwrap()
));
))
}
}
Err(_) => {
return Err(format!(
"Could not fetch {url}, do you have internet? Maybe their server is down?"
));
}
Err(_) => Err(format!(
"Could not fetch {url}, do you have internet? Maybe their server is down?"
)),
}
}