diff --git a/server/main-api/src/calendar/models.rs b/server/main-api/src/calendar/models.rs index 6efa77fe8..34b3ff39a 100644 --- a/server/main-api/src/calendar/models.rs +++ b/server/main-api/src/calendar/models.rs @@ -30,7 +30,7 @@ pub(super) struct Event { } impl Event { - pub(crate) async fn store( + pub async fn store( &self, tx: &mut sqlx::Transaction<'_, sqlx::Postgres>, ) -> Result { diff --git a/server/main-api/src/feedback/proposed_edits/discription.rs b/server/main-api/src/feedback/proposed_edits/discription.rs index 955ff09a8..b95eac30f 100644 --- a/server/main-api/src/feedback/proposed_edits/discription.rs +++ b/server/main-api/src/feedback/proposed_edits/discription.rs @@ -10,12 +10,12 @@ pub struct Description { } impl Description { - pub(crate) fn add_context(&mut self, additional_context: &str) { + pub fn add_context(&mut self, additional_context: &str) { if !additional_context.is_empty() { self.body += &format!("Additional context: {additional_context}\n"); } } - pub(crate) fn appply_set( + pub fn appply_set( &mut self, category_name: &'static str, set: HashMap, diff --git a/server/main-api/src/maps/fetch_tile.rs b/server/main-api/src/maps/fetch_tile.rs index 5a396f416..8f97bb38c 100644 --- a/server/main-api/src/maps/fetch_tile.rs +++ b/server/main-api/src/maps/fetch_tile.rs @@ -26,7 +26,7 @@ impl Display for TileLocation { } #[derive(Debug)] -pub(crate) struct FetchTileTask { +pub struct FetchTileTask { location: TileLocation, index: (u32, u32), } @@ -72,7 +72,7 @@ impl FetchTileTask { } } - pub(crate) fn offset_by(self, x_offset: i32, y_offset: i32) -> Self { + pub fn offset_by(self, x_offset: i32, y_offset: i32) -> Self { Self { location: TileLocation { x: zoom_aware_offset(self.location.z, self.location.x, x_offset), diff --git a/server/main-api/src/maps/overlay_map.rs b/server/main-api/src/maps/overlay_map.rs index 6adcac096..bc82e7caa 100644 --- a/server/main-api/src/maps/overlay_map.rs +++ b/server/main-api/src/maps/overlay_map.rs @@ -1,12 +1,13 @@ -use crate::maps::fetch_tile::FetchTileTask; -use crate::models::Location; use futures::{stream::FuturesUnordered, StreamExt}; use log::warn; -pub(crate) struct OverlayMapTask { - pub(crate) x: f64, - pub(crate) y: f64, - pub(crate) z: u32, +use crate::maps::fetch_tile::FetchTileTask; +use crate::models::Location; + +pub struct OverlayMapTask { + pub x: f64, + pub y: f64, + pub z: u32, } impl OverlayMapTask { @@ -103,9 +104,10 @@ fn is_in_range(x_pixels: u32, y_pixels: u32, x_index: u32, y_index: u32) -> bool #[cfg(test)] mod overlay_tests { - use super::*; use pretty_assertions::assert_eq; + use super::*; + #[test] fn test_lat_lon_z_to_xyz() { let (x, y, _) = lat_lon_z_to_xyz(52.520_008, 13.404_954, 17); diff --git a/server/main-api/src/maps/overlay_text.rs b/server/main-api/src/maps/overlay_text.rs index c295b9253..afcf3fd2d 100644 --- a/server/main-api/src/maps/overlay_text.rs +++ b/server/main-api/src/maps/overlay_text.rs @@ -12,7 +12,7 @@ lazy_static! { } const SCALE: PxScale = PxScale { x: 35.0, y: 35.0 }; -pub(crate) struct OverlayText { +pub struct OverlayText { x: i32, y: i32, text: String, diff --git a/server/main-api/src/search/search_executor/parser.rs b/server/main-api/src/search/search_executor/parser.rs index 46ab50e57..bfdeb2be6 100644 --- a/server/main-api/src/search/search_executor/parser.rs +++ b/server/main-api/src/search/search_executor/parser.rs @@ -12,7 +12,7 @@ pub struct Filter { usages: HashSet, } impl Filter { - pub(crate) fn as_meilisearch_filters(&self) -> String { + pub fn as_meilisearch_filters(&self) -> String { let mut filters = vec![]; if !self.parents.is_empty() { let parents: Vec<&str> = self.parents.iter().map(String::as_str).collect(); @@ -38,7 +38,7 @@ pub struct Sorting { } impl Sorting { - pub(crate) fn as_meilisearch_sorting(&self) -> Vec { + pub fn as_meilisearch_sorting(&self) -> Vec { self.location .iter() .map(|s| format!("_geoPoint({s}):asc")) @@ -60,7 +60,7 @@ pub struct ParsedQuery { } impl ParsedQuery { - pub(crate) fn relevant_enough_for_room_highligting(&self) -> bool { + pub fn relevant_enough_for_room_highligting(&self) -> bool { if self.tokens.len() == 1 { return true; } diff --git a/server/main-api/src/setup/database/alias.rs b/server/main-api/src/setup/database/alias.rs index c7117d6ea..167a01341 100644 --- a/server/main-api/src/setup/database/alias.rs +++ b/server/main-api/src/setup/database/alias.rs @@ -1,6 +1,7 @@ +use std::time::Instant; + use log::info; use serde::Deserialize; -use std::time::Instant; #[derive(Debug)] struct Alias { @@ -102,7 +103,7 @@ impl Alias { } } -pub(crate) async fn load_all_to_db( +pub async fn load_all_to_db( tx: &mut sqlx::Transaction<'_, sqlx::Postgres>, ) -> Result<(), crate::BoxedError> { let cdn_url = std::env::var("CDN_URL").unwrap_or_else(|_| "https://nav.tum.de/cdn".to_string()); diff --git a/server/main-api/src/setup/database/data.rs b/server/main-api/src/setup/database/data.rs index 2db9f6938..853f79655 100644 --- a/server/main-api/src/setup/database/data.rs +++ b/server/main-api/src/setup/database/data.rs @@ -82,7 +82,7 @@ impl DelocalisedValues { } } -pub(crate) async fn load_all_to_db( +pub async fn load_all_to_db( tx: &mut sqlx::Transaction<'_, sqlx::Postgres>, ) -> Result<(), crate::BoxedError> { let start = Instant::now(); diff --git a/server/main-api/src/setup/database/mod.rs b/server/main-api/src/setup/database/mod.rs index 223b21c3d..58d951646 100644 --- a/server/main-api/src/setup/database/mod.rs +++ b/server/main-api/src/setup/database/mod.rs @@ -1,9 +1,9 @@ +use log::info; + mod alias; mod data; -use log::info; - -pub(crate) async fn setup_database(pool: &sqlx::PgPool) -> Result<(), crate::BoxedError> { +pub async fn setup_database(pool: &sqlx::PgPool) -> Result<(), crate::BoxedError> { info!("setting up the database"); sqlx::migrate!("./migrations").run(pool).await?; info!("migrations complete"); diff --git a/server/main-api/src/setup/meilisearch.rs b/server/main-api/src/setup/meilisearch.rs index beb1aae1e..872f45b01 100644 --- a/server/main-api/src/setup/meilisearch.rs +++ b/server/main-api/src/setup/meilisearch.rs @@ -44,7 +44,7 @@ async fn wait_for_healthy(client: &Client) { } } -pub(crate) async fn setup_meilisearch() -> Result<(), crate::BoxedError> { +pub async fn setup_meilisearch() -> 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()); diff --git a/server/main-api/src/setup/mod.rs b/server/main-api/src/setup/mod.rs index e77362fd1..80c6dc003 100644 --- a/server/main-api/src/setup/mod.rs +++ b/server/main-api/src/setup/mod.rs @@ -1,5 +1,5 @@ #[cfg(not(feature = "skip_db_setup"))] -pub(crate) mod database; +pub mod database; #[cfg(not(feature = "skip_ms_setup"))] -pub(crate) mod meilisearch; +pub mod meilisearch;