@@ -223,14 +223,11 @@ impl OsHelper {
223
223
224
224
let icon_filename = app_id. to_string ( ) + ".png" ;
225
225
let full_stored_icon_path = icons_root_dir. join ( icon_filename) ;
226
- let icon_path_str = full_stored_icon_path
227
- . as_path ( )
228
- . to_str ( )
229
- . unwrap_or ( "invalid" ) ;
226
+ let icon_path = full_stored_icon_path. as_path ( ) ;
230
227
231
228
app_info
232
229
. icon_path
233
- . map ( |icon_path| create_icon_for_app ( icon_path. as_str ( ) , icon_path_str ) ) ;
230
+ . map ( |icon_path| create_icon_for_app ( icon_path. as_str ( ) , icon_path ) ) ;
234
231
235
232
// "C:\Users\Browsers\AppData\Local\Programs\WorkFlowy\WorkFlowy.exe" "%1"
236
233
// "C:\Users\Browsers\AppData\Roaming\Spotify\Spotify.exe" --protocol-uri="%1"
@@ -266,6 +263,8 @@ impl OsHelper {
266
263
let profiles =
267
264
supported_app. find_profiles ( executable_path_best_guess. clone ( ) , app_config_dir_abs) ;
268
265
266
+ let icon_path_str = full_stored_icon_path. to_str ( ) . unwrap_or ( "invalid" ) ;
267
+
269
268
let browser = InstalledBrowser {
270
269
command : command_parts. clone ( ) ,
271
270
executable_path : executable_path_best_guess. to_str ( ) . unwrap ( ) . to_string ( ) ,
@@ -290,7 +289,7 @@ fn remove_quotes(binary_path: &str) -> &str {
290
289
return binary_path;
291
290
}
292
291
293
- pub fn create_icon_for_app ( full_path_and_index : & str , icon_path : & str ) {
292
+ pub fn create_icon_for_app ( full_path_and_index : & str , icon_path : & Path ) {
294
293
// e.g `C:\Program Files (x86)\Google\Chrome\Application\chrome.exe,0`
295
294
// or `"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",0`
296
295
let split: Vec < & str > = full_path_and_index. split ( "," ) . collect ( ) ;
0 commit comments