@@ -366,15 +366,14 @@ fn main() {
366
366
let current_dir: String = match env:: current_dir ( ) {
367
367
Ok ( t) => t. to_str ( ) . unwrap ( ) . to_string ( ) ,
368
368
Err ( _) => {
369
- #[ cfg( target_family = "unix" ) ]
370
- {
369
+ if cfg ! ( target_family = "unix" ) {
371
370
println ! ( "Failed to read current directory, setting /home instead" ) ;
372
371
"/home" . to_string ( )
373
- }
374
- #[ cfg( target_family = "windows" ) ]
375
- {
372
+ } else if cfg ! ( target_family = "windows" ) {
376
373
println ! ( "Failed to read current directory, setting C:\\ instead" ) ;
377
374
"C:\\ " . to_string ( )
375
+ } else {
376
+ "" . to_string ( )
378
377
}
379
378
}
380
379
} ;
@@ -408,13 +407,11 @@ fn main() {
408
407
}
409
408
// Set Excluded Items
410
409
{
411
- #[ cfg( target_family = "unix" ) ]
412
- {
413
- entry_excluded_items. set_text ( "*/.git/,*/node_modules/,*/lost+found/" ) ;
410
+ if cfg ! ( target_family = "unix" ) {
411
+ entry_excluded_items. set_text ( "*/.git/*,*/node_modules/*,*/lost+found/*" ) ;
414
412
}
415
- #[ cfg( target_family = "windows" ) ]
416
- {
417
- entry_excluded_items. set_text ( "*\\ .git\\ ,*\\ node_modules\\ ,*:\\ Windows\\ ,:/Windows/" ) ;
413
+ if cfg ! ( target_family = "windows" ) {
414
+ entry_excluded_items. set_text ( "*/.git/*,*/node_modules/*,*/lost+found/*,*:/windows/*" ) ;
418
415
}
419
416
}
420
417
}
@@ -912,7 +909,10 @@ fn main() {
912
909
for path_to_delete in vec_path_to_delete {
913
910
let mut vec_tree_path_to_delete: Vec < gtk:: TreePath > = Vec :: new ( ) ;
914
911
915
- let iter = list_store. get_iter_first ( ) . unwrap ( ) ;
912
+ let iter = match list_store. get_iter_first ( ) {
913
+ Some ( t) => t,
914
+ None => break ,
915
+ } ;
916
916
let mut take_child_mode = false ; // When original image is searched one, we must remove all occurences of its children
917
917
let mut prepared_for_delete;
918
918
loop {
0 commit comments