fix: resolve ownership and borrowing errors and add serde traits
Co-authored-by: aider (openai/andrew/openrouter/google/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -57,7 +57,7 @@ pub async fn handle_list_items(
|
||||
// Apply ordering (default is newest first)
|
||||
match params.order.as_deref().unwrap_or("newest") {
|
||||
"newest" => items_with_meta.sort_by(|a, b| b.item.ts.cmp(&a.item.ts)),
|
||||
"oldest" => items_with_meta.sort_by(|a, b| a.item.ts.cmp(&a.item.ts)),
|
||||
"oldest" => items_with_meta.sort_by(|a, b| a.item.ts.cmp(&b.item.ts)),
|
||||
_ => items_with_meta.sort_by(|a, b| b.item.ts.cmp(&a.item.ts)), // default to newest
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ pub async fn handle_list_items(
|
||||
.into_iter()
|
||||
.map(|item_with_meta| {
|
||||
let item_id = item_with_meta.item.id.unwrap_or(0);
|
||||
let item_tags = item_with_meta.tags.into_iter().map(|t| t.name).collect();
|
||||
let item_tags: Vec<String> = item_with_meta.tags.iter().map(|t| t.name.clone()).collect();
|
||||
let item_meta = item_with_meta.meta_as_map();
|
||||
|
||||
ItemInfo {
|
||||
|
||||
Reference in New Issue
Block a user