Skip to content

Commit

Permalink
fix: Use break instead of return in audio boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Dec 16, 2023
1 parent 02fb844 commit 383d4bf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/components/input/output_stream_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ impl OutputStreamEntry {
for entry in 0..*index {
if model_list.string(entry) == Some(name.2.clone().into()) {
imp.reset_source_selection.set_selected(entry);
break;
}
}
} else {
Expand All @@ -92,6 +93,7 @@ impl OutputStreamEntry {
for entry in 0..*index {
if model_list.string(entry) == Some(name.alias.clone().into()) {
imp.reset_source_selection.set_selected(entry);
break;
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/components/input/source_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub fn populate_sources(input_box: Arc<SourceBox>) {
for entry in 0..*index {
if model_list.string(entry) == Some(name.alias.clone().into()) {
input_box_imp.reset_source_dropdown.set_selected(entry);
return;
break;
}
}
input_box_imp.reset_source_dropdown.connect_selected_notify(
Expand Down Expand Up @@ -261,7 +261,7 @@ pub fn refresh_default_source(new_source: Source, input_box: Arc<SourceBox>, ent
for entry in 0..*imp.reset_model_index.read().unwrap() {
if model_list.string(entry) == Some(new_source.alias.clone().into()) {
imp.reset_source_dropdown.set_selected(entry);
return;
break;
}
}
}
Expand Down Expand Up @@ -471,7 +471,7 @@ pub fn start_input_box_listener(conn: Connection, source_box: Arc<SourceBox>) ->
for entry in 0..*index {
if model_list.string(entry) == Some(alias.clone().into()) {
model_list.remove(entry);
return;
break;
}
}
if *index > 1 {
Expand Down Expand Up @@ -612,6 +612,7 @@ pub fn start_input_box_listener(conn: Connection, source_box: Arc<SourceBox>) ->
for entry in 0..*index {
if model_list.string(entry) == Some(alias.clone().into()) {
imp.reset_source_selection.set_selected(entry);
break;
}
}
});
Expand Down
Empty file removed src/components/output/audio_box.rs
Empty file.
2 changes: 2 additions & 0 deletions src/components/output/input_stream_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ impl InputStreamEntry {
for entry in 0..*index {
if model_list.string(entry) == Some(name.2.clone().into()) {
imp.reset_sink_selection.set_selected(entry);
break;
}
}
} else {
Expand All @@ -101,6 +102,7 @@ impl InputStreamEntry {
for entry in 0..*index {
if model_list.string(entry) == Some(name.alias.clone().into()) {
imp.reset_sink_selection.set_selected(entry);
break;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/output/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod audio_box;
pub mod input_stream_entry;
pub mod input_stream_entry_impl;
pub mod sink_box;
Expand Down
8 changes: 4 additions & 4 deletions src/components/output/sink_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ pub fn populate_sinks(output_box: Arc<SinkBox>) {
for entry in 0..*index {
if model_list.string(entry) == Some(name.alias.clone().into()) {
output_box_imp.reset_sink_dropdown.set_selected(entry);
return;
break;
}
}
output_box_imp.reset_sink_dropdown.connect_selected_notify(
Expand Down Expand Up @@ -265,7 +265,7 @@ pub fn refresh_default_sink(new_sink: Sink, output_box: Arc<SinkBox>, entry: boo
for entry in 0..*index {
if model_list.string(entry) == Some(new_sink.alias.clone().into()) {
imp.reset_sink_dropdown.set_selected(entry);
return;
break;
}
}
}
Expand Down Expand Up @@ -474,7 +474,7 @@ pub fn start_output_box_listener(conn: Connection, sink_box: Arc<SinkBox>) -> Co
for entry in 0..*index {
if model_list.string(entry) == Some(alias.clone().into()) {
model_list.remove(entry);
return;
break;
}
}
if *index > 1 {
Expand Down Expand Up @@ -611,7 +611,7 @@ pub fn start_output_box_listener(conn: Connection, sink_box: Arc<SinkBox>) -> Co
for entry in 0..*index {
if model_list.string(entry) == Some(alias.clone().into()) {
imp.reset_sink_selection.set_selected(entry);
return;
break;
}
}
});
Expand Down

0 comments on commit 383d4bf

Please sign in to comment.