aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/util.rs
diff options
context:
space:
mode:
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)
+}