diff --git a/crates/libs/config/src/lib.rs b/crates/libs/config/src/lib.rs index 10b7808..9238951 100644 --- a/crates/libs/config/src/lib.rs +++ b/crates/libs/config/src/lib.rs @@ -24,7 +24,7 @@ fn get_environment_filename() -> Result { 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) } diff --git a/crates/services/api/src/routes/tournaments.rs b/crates/services/api/src/routes/tournaments.rs index 3bd5496..3c9debc 100644 --- a/crates/services/api/src/routes/tournaments.rs +++ b/crates/services/api/src/routes/tournaments.rs @@ -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); } }