File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,20 +36,19 @@ fn get_asset_path(asset: &str) -> String {
3636 if cfg ! ( debug_assertions) || cfg ! ( target_arch = "wasm32" ) {
3737 format ! ( "assets/{}" , asset)
3838 } else {
39- let exe_path = env:: current_exe ( )
40- . unwrap_or_else ( |e| panic ! ( "Failed to get current executable path: {}" , e) ) ;
39+ let exe_path = env:: current_exe ( ) . expect ( "Failed to get current executable path" ) ;
4140
4241 let exe_dir = exe_path
4342 . parent ( )
44- . unwrap_or_else ( || panic ! ( "Failed to get executable directory" ) ) ;
43+ . expect ( "Failed to get executable directory" ) ;
4544
4645 let mut asset_path = exe_dir. to_path_buf ( ) ;
4746 asset_path. push ( "assets" ) ;
4847 asset_path. push ( asset) ;
4948
5049 asset_path
5150 . to_str ( )
52- . unwrap_or_else ( || panic ! ( "Failed to convert path to string" ) )
51+ . expect ( "Failed to convert path to string" )
5352 . to_string ( )
5453 }
5554}
You can’t perform that action at this time.
0 commit comments