Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SpartanPlume committed Oct 29, 2024
1 parent f5b1acd commit ba76fa1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/libs/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn get_environment_filename() -> Result<String, ConfigError> {
let environment: Environment = std::env::var("APP_ENVIRONMENT")
.unwrap_or_else(|_| "local".into())
.try_into()
.map_err(|e| ConfigError::InvalidEnvironment(e))?;
.map_err(ConfigError::InvalidEnvironment)?;
let environment_filename = format!("{}.yml", environment.as_str());
Ok(environment_filename)
}
Expand Down
5 changes: 1 addition & 4 deletions crates/services/api/src/routes/tournaments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ pub async fn get_tournaments(
let per_page = pagination.per_page.unwrap();
query_builder = query_builder.limit(per_page);
if pagination.page.is_some() {
let mut page = pagination.page.unwrap();
if page > 0 {
page -= 1;
}
let page = pagination.page.unwrap().saturating_sub(1);
query_builder = query_builder.offset(page * per_page);
}
}
Expand Down

0 comments on commit ba76fa1

Please sign in to comment.