scene: conversation: use Display instead of ToString for clippy++
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::fmt::Display;
|
||||
|
||||
use async_openai::types::chat::{ChatCompletionRequestAssistantMessage, ChatCompletionRequestAssistantMessageContent, ChatCompletionRequestMessage, ChatCompletionRequestSystemMessage, ChatCompletionRequestSystemMessageContent, ChatCompletionRequestUserMessage, ChatCompletionRequestUserMessageContent};
|
||||
use ratatui::style::{self, Style};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -50,16 +52,16 @@ impl ConversationEntry {
|
||||
}
|
||||
}
|
||||
|
||||
impl ToString for ConversationEntry {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
impl Display for ConversationEntry {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_str(match self {
|
||||
ConversationEntry::Spoken(Speaker::Eva, text) => text,
|
||||
ConversationEntry::Spoken(Speaker::ShipComputer, text) => text,
|
||||
ConversationEntry::StageDirection(text) => text,
|
||||
ConversationEntry::SystemMessage(text) => text,
|
||||
ConversationEntry::Spoken(Speaker::User, text) => text,
|
||||
ConversationEntry::ShipComputerCommand(text) => text
|
||||
}.clone()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user