Skip to content

Commit

Permalink
fixed linting errors found by clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed May 9, 2024
1 parent 6d8e56d commit 67fe289
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions server/main-api/src/calendar/refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::calendar::connectum::APIRequestor;
struct LocationKey {
key: String,
}
pub async fn refresh_entries_hourly(pool: &PgPool) {
pub async fn entries_hourly(pool: &PgPool) {
let one_hour = Duration::from_secs(60 * 60);
let mut interval = tokio::time::interval(one_hour);
let api = APIRequestor::from(pool);
Expand All @@ -31,7 +31,7 @@ pub async fn refresh_entries_hourly(pool: &PgPool) {
};
for LocationKey { key } in ids {
if let Err(e) = api.refresh(&key).await {
error!("Could not download calendar for {key} because {e:?}")
error!("Could not download calendar for {key} because {e:?}");
}
}
interval.tick().await;
Expand Down
6 changes: 3 additions & 3 deletions server/main-api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ async fn main() -> Result<(), BoxedError> {
.connect(&connection_string())
.await
.unwrap();
setup::database::setup_database(&pool).await.unwrap();
setup::database::setup(&pool).await.unwrap();
}
#[cfg(not(feature = "skip_ms_setup"))]
setup::meilisearch::setup_meilisearch().await.unwrap();
setup::meilisearch::setup().await.unwrap();
});
let refresh_calendar = tokio::spawn(async move {
// we give the setup a bit of time to finish
Expand All @@ -94,7 +94,7 @@ async fn main() -> Result<(), BoxedError> {
.connect(&connection_string())
.await
.unwrap();
calendar::refresh::refresh_entries_hourly(&pool).await
calendar::refresh::entries_hourly(&pool).await;
});

debug!("setting up metrics");
Expand Down
2 changes: 1 addition & 1 deletion server/main-api/src/maps/fetch_tile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct FetchTileTask {
fn zoom_aware_offset(zoom: u32, value: u32, offset: i32) -> u32 {
// if we go over the edge of the world, we want to pop in on the other side
let possible_tiles: i64 = (4_i64).pow(zoom);
let offset_value = value as i64 + offset as i64;
let offset_value = i64::from(value) + i64::from(offset);
if offset_value < 0 {
return (possible_tiles + offset_value) as u32;
}
Expand Down
2 changes: 1 addition & 1 deletion server/main-api/src/setup/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use log::info;
mod alias;
mod data;

pub async fn setup_database(pool: &sqlx::PgPool) -> Result<(), crate::BoxedError> {
pub async fn setup(pool: &sqlx::PgPool) -> Result<(), crate::BoxedError> {
info!("setting up the database");
sqlx::migrate!("./migrations").run(pool).await?;
info!("migrations complete");
Expand Down
2 changes: 1 addition & 1 deletion server/main-api/src/setup/meilisearch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async fn wait_for_healthy(client: &Client) {
}
}

pub async fn setup_meilisearch() -> Result<(), crate::BoxedError> {
pub async fn setup() -> Result<(), crate::BoxedError> {
info!("setting up meilisearch");
let start = std::time::Instant::now();
let ms_url = std::env::var("MIELI_URL").unwrap_or_else(|_| "http://localhost:7700".to_string());
Expand Down

0 comments on commit 67fe289

Please sign in to comment.