clippy++ and report internal error types from tools
This commit is contained in:
@@ -91,7 +91,7 @@ impl Ui {
|
||||
let throbber = Throbber::default().throbber_style(Style::new().cyan());
|
||||
frame.render_stateful_widget(throbber, throb_area, &mut self.throbber_state);
|
||||
} else {
|
||||
frame.render_widget(Clear::default(), throb_area);
|
||||
frame.render_widget(Clear, throb_area);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ impl Ui {
|
||||
let throbber = Throbber::default().throbber_style(Style::new().red()).throbber_set(throbber_widgets_tui::WHITE_SQUARE);
|
||||
frame.render_stateful_widget(throbber, throb_area, &mut self.throbber_state);
|
||||
} else {
|
||||
frame.render_widget(Clear::default(), throb_area);
|
||||
frame.render_widget(Clear, throb_area);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,6 @@ impl Ui {
|
||||
self.predictions.insert(PredictionAction::SetPlaylist(playlist_name)).await;
|
||||
} else {
|
||||
log::error!("Invalid episode number format. Use /episode [number]");
|
||||
return;
|
||||
}
|
||||
},
|
||||
"/playlist" => {
|
||||
@@ -193,7 +192,6 @@ impl Ui {
|
||||
},
|
||||
"/computer" => {
|
||||
self.predictions.insert(PredictionAction::ComputerCommand(arg.to_string())).await;
|
||||
return;
|
||||
},
|
||||
_ => {
|
||||
log::error!("Unknown command. Available commands: /episode [number], /narrative [text], /event [text], /computer [text], /timer [minutes]");
|
||||
@@ -221,7 +219,7 @@ impl Ui {
|
||||
KeyCode::Enter => {
|
||||
let row_num = self.conversation_state.selected().unwrap();
|
||||
if let ConversationEntry::Spoken(Speaker::Eva, text) = &self.conversation[self.conversation.len() - 1 - row_num] {
|
||||
self.tts.speak(text.clone()).await;
|
||||
self.tts.speak(text.clone()).await.unwrap();
|
||||
self.focus_state = FocusState::UserInput;
|
||||
self.conversation_state.select(None);
|
||||
self.reply_state.select_first();
|
||||
@@ -241,10 +239,10 @@ impl Ui {
|
||||
KeyCode::Char('x') if key.modifiers.contains(KeyModifiers::CONTROL) => {
|
||||
if self.recording_audio {
|
||||
self.recording_audio = false;
|
||||
self.transcription.stop();
|
||||
self.transcription.stop().unwrap();
|
||||
} else {
|
||||
self.recording_audio = true;
|
||||
self.transcription.start();
|
||||
self.transcription.start().unwrap();
|
||||
}
|
||||
},
|
||||
KeyCode::Down => self.reply_state.select_next(),
|
||||
@@ -256,12 +254,10 @@ impl Ui {
|
||||
let next_msg = self.user_input.value_and_reset();
|
||||
if next_msg.trim().is_empty() {
|
||||
self.insert_selected_prompt().await;
|
||||
} else if next_msg.starts_with("/") {
|
||||
self.on_command(&next_msg).await;
|
||||
} else {
|
||||
if next_msg.starts_with("/") {
|
||||
self.on_command(&next_msg).await;
|
||||
} else {
|
||||
self.predictions.insert(PredictionAction::ConversationAppend(ConversationEntry::Spoken(Speaker::User, next_msg))).await;
|
||||
}
|
||||
self.predictions.insert(PredictionAction::ConversationAppend(ConversationEntry::Spoken(Speaker::User, next_msg))).await;
|
||||
}
|
||||
},
|
||||
_ => {self.user_input.handle_event(&evt);},
|
||||
|
||||
Reference in New Issue
Block a user