chore: clippy performance improvements

This commit is contained in:
Per Stark
2025-10-15 22:24:59 +02:00
parent 35ff4e1464
commit c3a7e8dc59
11 changed files with 51 additions and 55 deletions

View File

@@ -137,7 +137,7 @@ pub async fn show_existing_chat(
ChatPageData {
history: messages,
user,
conversation: Some(conversation.clone()),
conversation: Some(conversation),
conversation_archive,
},
))

View File

@@ -221,7 +221,7 @@ pub async fn get_task_updates_stream(
// Send a specific event that HTMX uses to close the connection
// Send a event to reload the recent content
// Send a event to remove the loading indicatior
let check_icon = state.templates.render("icons/check_icon.html", &context!{}).unwrap_or("Ok".to_string());
let check_icon = state.templates.render("icons/check_icon.html", &context!{}).unwrap_or_else(|_| "Ok".to_string());
yield Ok(Event::default().event("stop_loading").data(check_icon));
yield Ok(Event::default().event("update_latest_content").data("Update latest content"));
yield Ok(Event::default().event("close_stream").data("Stream complete"));

View File

@@ -55,7 +55,7 @@ pub async fn show_new_knowledge_entity_form(
) -> Result<impl IntoResponse, HtmlError> {
let entity_types: Vec<String> = KnowledgeEntityType::variants()
.iter()
.map(|s| s.to_string())
.map(|&s| s.to_owned())
.collect();
let existing_entities = User::get_knowledge_entities(&user.id, &state.db).await?;
@@ -729,7 +729,7 @@ pub async fn show_edit_knowledge_entity_form(
// Get entity types
let entity_types: Vec<String> = KnowledgeEntityType::variants()
.iter()
.map(|s| s.to_string())
.map(|&s| s.to_owned())
.collect();
// Get the entity and validate ownership