Refactored environmental functions

This commit is contained in:
Thorsten Sommer 2024-11-05 15:13:59 +01:00
parent 74522dc22a
commit eb8165556a
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 9 additions and 9 deletions

View File

@ -0,0 +1,7 @@
pub fn is_dev() -> bool {
cfg!(debug_assertions)
}
pub fn is_prod() -> bool {
!is_dev()
}

View File

@ -1 +1,2 @@
pub mod encryption;
pub mod encryption;
pub mod environment;

View File

@ -640,14 +640,6 @@ async fn dotnet_ready(_token: APIToken) {
}
}
pub fn is_dev() -> bool {
cfg!(debug_assertions)
}
pub fn is_prod() -> bool {
!is_dev()
}
fn get_available_port() -> Option<u16> {
TcpListener::bind(("127.0.0.1", 0))
.map(|listener| listener.local_addr().unwrap().port())