Skip to content

Commit

Permalink
refactor: use break-label to break nested loop
Browse files Browse the repository at this point in the history
  • Loading branch information
soul committed Feb 24, 2024
1 parent 74edff5 commit 3e0befb
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src-tauri/src/services/category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,12 @@ fn filter_new_interfaces(
let config_json = config.read_config().unwrap();

let mut config_interfaces = vec![];
let mut find_config_interfaces = false;

for project in config_json.project_list {
if find_config_interfaces == true {
break;
}
'project: for project in config_json.project_list {
for category in project.categories {
if find_config_interfaces == true {
break;
}
if category.id == category_id {
config_interfaces = category.interfaces;
find_config_interfaces = true;
break 'project;
}
}
}
Expand Down

0 comments on commit 3e0befb

Please sign in to comment.