Skip to content

Commit

Permalink
Resolve futures not awaited
Browse files Browse the repository at this point in the history
  • Loading branch information
nick42d committed Nov 13, 2024
1 parent ae25d08 commit 5a2a6f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions youtui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ impl Youtui {
let mut task_manager = async_callback_manager::AsyncCallbackManager::new()
.with_on_task_received_callback(|task| {
info!(
"Received task {:?}: - type_id: {:?}, sender_id: {:?}, constraint: {:?}",
"Received task {:?}: type_id: {:?}, sender_id: {:?}, constraint: {:?}",
task.type_name, task.type_id, task.sender_id, task.constraint
)
})
.with_on_response_received_callback(|response| {
info!(
"Received response to {:?}: - type_id: {:?}, sender_id: {:?}, task_id: {:?}",
"Received response to {:?}: type_id: {:?}, sender_id: {:?}, task_id: {:?}",
response.type_name, response.type_id, response.sender_id, response.task_id
)
});
Expand Down
6 changes: 2 additions & 4 deletions youtui/src/app/ui/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ impl Browser {
// XXX: Currently has race conditions - if list is cleared response will arrive
// afterwards. Proposal: When recieving a message from the app validate
// against query string.
async fn fetch_search_suggestions(&mut self) {
fn fetch_search_suggestions(&mut self) {
// No need to fetch search suggestions if contents is empty.
if self.artist_list.search.search_contents.is_empty() {
self.artist_list.search.search_suggestions.clear();
Expand All @@ -407,7 +407,6 @@ impl Browser {
}
Err(e) => {
error!("Error <{e}> recieved getting search suggestions");
return;
}
};
if let Err(e) = self.async_tx.add_callback(
Expand Down Expand Up @@ -466,7 +465,6 @@ impl Browser {
}
Err(e) => {
error!("Error <{e}> recieved getting artists.");
return;
}
};
if let Err(e) = self.async_tx.add_callback(
Expand All @@ -486,7 +484,7 @@ impl Browser {
pub fn handle_song_list_loading(&mut self) {
self.album_songs_list.list.state = ListStatus::Loading;
}
pub async fn replace_artist_list(&mut self, artist_list: Vec<SearchResultArtist>) {
pub fn replace_artist_list(&mut self, artist_list: Vec<SearchResultArtist>) {
self.artist_list.list = artist_list;
// XXX: What to do if position in list was greater than new list length?
// Handled by this function?
Expand Down

0 comments on commit 5a2a6f7

Please sign in to comment.