mirror of
https://github.com/perstarkse/minne.git
synced 2026-03-25 02:41:27 +01:00
chore: clippy performance improvements
This commit is contained in:
@@ -137,7 +137,7 @@ pub async fn show_existing_chat(
|
||||
ChatPageData {
|
||||
history: messages,
|
||||
user,
|
||||
conversation: Some(conversation.clone()),
|
||||
conversation: Some(conversation),
|
||||
conversation_archive,
|
||||
},
|
||||
))
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user