Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: danbugs <[email protected]>
  • Loading branch information
danbugs committed Feb 18, 2024
1 parent 8522f41 commit 888d57a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions lib/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ where
break 'inner;
}
Err(e) => {
if e.to_string().contains("429")
|| e.to_string()
.contains("Our services aren't available right now")
if e.to_string()
.contains("Our services aren't available right now")

Check warning on line 89 in lib/src/common.rs

View check run for this annotation

Codecov / codecov/patch

lib/src/common.rs#L88-L89

Added lines #L88 - L89 were not covered by tests
|| e.to_string().contains("error sending request for url")
{
// 429 (too many reqs) or outage, want to wait it out
Expand Down Expand Up @@ -138,6 +137,9 @@ where
);
curr_page = 1;
continue;
} else {
// quit program, we have an error that we can't recover from
panic!("🤔 got 'Failed to parse' at page {}!", curr_page);

Check warning on line 142 in lib/src/common.rs

View check run for this annotation

Codecov / codecov/patch

lib/src/common.rs#L142

Added line #L142 was not covered by tests
}
} else {
maybe_sgv = maybe_sgv.update();
Expand Down
4 changes: 2 additions & 2 deletions lib/src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn maybe_get_games_from_set(
false
}
})
.map(|rgs| rgs.selectionValue)
.and_then(|rgs| rgs.selectionValue)

Check warning on line 25 in lib/src/game.rs

View check run for this annotation

Codecov / codecov/patch

lib/src/game.rs#L25

Added line #L25 was not covered by tests
} else {
None
};
Expand All @@ -36,7 +36,7 @@ pub fn maybe_get_games_from_set(
false
}
})
.map(|ogs| ogs.selectionValue)
.and_then(|ogs| ogs.selectionValue)

Check warning on line 39 in lib/src/game.rs

View check run for this annotation

Codecov / codecov/patch

lib/src/game.rs#L39

Added line #L39 was not covered by tests
} else {
None
};
Expand Down
2 changes: 1 addition & 1 deletion startgg_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub struct Game {
#[derive(Debug, Clone, Deserialize)]
pub struct GameSelection {
pub entrant: Option<Entrant>,
pub selectionValue: i32, // this will be an i32 that represents the character
pub selectionValue: Option<i32>, // this will be an i32 that represents the character
}

#[derive(Debug, Clone, Deserialize)]
Expand Down

0 comments on commit 888d57a

Please sign in to comment.