Refactored environmental functions

This commit is contained in:
tsommer committed 2024-11-05 15:13:59 +01:00
1 parent 74522dc22a
commit eb8165556a
3 files changed
+9 -9

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
pub fn is_dev() -> bool {
cfg!(debug_assertions)
}
pub fn is_prod() -> bool {
!is_dev()
}
+2 -1
View File
@@ -1 +1,2 @@
pub mod encryption;
pub mod encryption;
pub mod environment;
-8
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())