Clarify names

This commit is contained in:
Wojciech Kozlowski 2024-02-12 22:33:54 +01:00
parent cc3de25192
commit 39e0c7c3f6
2 changed files with 3 additions and 4 deletions

View File

@ -288,7 +288,7 @@ impl<MH: IMusicHoard> IAppInteractReloadPrivate for App<MH> {
match result { match result {
Ok(()) => { Ok(()) => {
self.selection self.selection
.select(self.music_hoard.get_collection(), previous); .select_by_id(self.music_hoard.get_collection(), previous);
self.state = AppState::Browse(()) self.state = AppState::Browse(())
} }
Err(err) => self.state = AppState::Error(err.to_string()), Err(err) => self.state = AppState::Error(err.to_string()),

View File

@ -70,8 +70,7 @@ impl Selection {
} }
} }
// FIXME: the name is not suitable in the presence of other `select` methods. pub fn select_by_id(&mut self, artists: &[Artist], selected: ActiveSelection) {
pub fn select(&mut self, artists: &[Artist], selected: ActiveSelection) {
self.artist.reinitialise(artists, selected.artist); self.artist.reinitialise(artists, selected.artist);
} }
@ -85,7 +84,7 @@ impl Selection {
pub fn reset_artist(&mut self, artists: &[Artist]) { pub fn reset_artist(&mut self, artists: &[Artist]) {
if self.artist.state.list.selected() != Some(0) { if self.artist.state.list.selected() != Some(0) {
self.select(artists, ActiveSelection { artist: None }); self.select_by_id(artists, ActiveSelection { artist: None });
} }
} }