aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/util.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-05-11 23:22:36 +0200
committerGitHub <noreply@github.com>2023-05-11 23:22:36 +0200
commit95fa3d72ace4d92f235ac0da1f5333a50201d441 (patch)
tree32974f136b186a3fbbce86d4faad1417f4653b18 /src-tauri/src/util.rs
parent57d9b827fde3bf587e3a0b146f0ec70ddb52f5aa (diff)
downloadFlightCore-95fa3d72ace4d92f235ac0da1f5333a50201d441.tar.gz
FlightCore-95fa3d72ace4d92f235ac0da1f5333a50201d441.zip
refactor: Move some functions to utility module (#347)
* refactor: Move `force_panic` to utility module * refactor: Move `is_debug_mode` to utility module
Diffstat (limited to 'src-tauri/src/util.rs')
-rw-r--r--src-tauri/src/util.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src-tauri/src/util.rs b/src-tauri/src/util.rs
new file mode 100644
index 00000000..0c2c5da4
--- /dev/null
+++ b/src-tauri/src/util.rs
@@ -0,0 +1,14 @@
+//! This module contains various utility/helper functions that do not fit into any other module
+
+/// This function's only use is to force a `panic!()`
+// This must NOT be async to ensure crashing whole application.
+#[tauri::command]
+pub fn force_panic() {
+ panic!("Force panicked!");
+}
+
+/// Returns true if built in debug mode
+#[tauri::command]
+pub async fn is_debug_mode() -> bool {
+ cfg!(debug_assertions)
+}