Skip to content

Commit

Permalink
chore: suggest using () as error
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoIeni committed Jul 31, 2023
1 parent 055cf70 commit b6019f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/workshop/tests/api/02_swapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ async fn retrieve_luke_height_from_swapi() {
let base_url = "http://127.0.0.1:9992";
// You can ignore the timeout for this exercise.
let timeout = Duration::from_secs(2);
// The `new` function must return a `Result` (notice we `unwrap` it).
// For this test, we don't care about the error: the `new` function will always succeed.
// You can use the unit type `()` as the error type: `Result<SwapiClient, ()>`.
let swapi_client = SwapiClient::new(base_url.to_string(), timeout).unwrap();
let luke = Person {
name: "Luke Skywalker".to_string(),
Expand Down

0 comments on commit b6019f6

Please sign in to comment.