@@ -16,7 +16,7 @@ use crate::error::AppError;
1616pub fn run ( ) -> Result < ( ) , AppError > {
1717 let _ = env_logger:: try_init ( ) ;
1818
19- tauri:: Builder :: default ( )
19+ let builder = tauri:: Builder :: default ( )
2020 . plugin ( tauri_plugin_dialog:: init ( ) )
2121 . plugin ( tauri_plugin_fs:: init ( ) )
2222 . plugin ( tauri_plugin_opener:: init ( ) )
@@ -71,6 +71,9 @@ pub fn run() -> Result<(), AppError> {
7171 let ( tx, rx) = std:: sync:: mpsc:: channel :: < Result < AppState , String > > ( ) ;
7272
7373 std:: thread:: spawn ( move || {
74+ // Runtime creation failure is unrecoverable β app cannot function without async runtime.
75+ // Using expect() here is appropriate as there's no meaningful recovery path.
76+ #[ allow( clippy:: disallowed_methods) ]
7477 let rt = tokio:: runtime:: Runtime :: new ( ) . expect ( "failed to create tokio runtime" ) ;
7578 let result = rt. block_on ( async {
7679 let app_state = AppState :: new ( & db_url) . await . map_err ( |e| e. to_string ( ) ) ?;
@@ -91,8 +94,12 @@ pub fn run() -> Result<(), AppError> {
9194 app_handle. manage ( app_state) ;
9295
9396 Ok ( ( ) )
94- } )
95- . run ( tauri:: generate_context!( ) ) ?;
97+ } ) ;
98+
99+ // tauri::generate_context!() macro expansion contains .unwrap() calls.
100+ // This is part of Tauri's code generation and cannot be avoided.
101+ #[ allow( clippy:: disallowed_methods) ]
102+ builder. run ( tauri:: generate_context!( ) ) ?;
96103
97104 Ok ( ( ) )
98105}
0 commit comments