Skip to content

Commit 0efbfcc

Browse files
committed
Code style change on select path modal get selected path
1 parent edb0cd7 commit 0efbfcc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/components/select_path_modal.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,13 @@ impl SelectPathModal {
5252

5353
/// Returns the currently selected path. If none are selected then the Option value will be None.
5454
pub fn get_selected_path(&self) -> Option<PathEnum> {
55-
let mut path: Option<PathEnum> = None;
5655
for current_path in &self.toggleable_paths {
5756
if current_path.state {
58-
path = Some(current_path.unwrap());
59-
break;
57+
return Some(current_path.unwrap());
6058
}
6159
}
6260

63-
path
61+
return None;
6462
}
6563

6664
/// This function will modify current_paths so that it only has one selected - preferring the newer of the two items if there are two items selected

0 commit comments

Comments
 (0)