chore: fix clippy warnings and run rustfmt
This commit is contained in:
1 parent
fecd8bf33f
commit
3765e6b05d
21 files changed
+420
-369
No files matched your search
@@ -191,10 +191,9 @@ pub fn html_to_markdown(html: &str) -> String {
|
||||
out.push_str("* ");
|
||||
}
|
||||
}
|
||||
"/li"
|
||||
if !in_cell => {
|
||||
out.push('\n');
|
||||
}
|
||||
"/li" if !in_cell => {
|
||||
out.push('\n');
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
} else if c == '&' {
|
||||
@@ -510,7 +509,8 @@ pub async fn process_clipboard_snapshot(state: Arc<MemoryState>) {
|
||||
.search_index
|
||||
.read()
|
||||
.await
|
||||
.index_clipboard_image(&doc_id, &path_str, text);
|
||||
.index_clipboard_image(&doc_id, &path_str, text)
|
||||
.await;
|
||||
}
|
||||
|
||||
let cached = crate::state::CachedClipboardImage {
|
||||
@@ -567,9 +567,10 @@ pub async fn process_clipboard_snapshot(state: Arc<MemoryState>) {
|
||||
|
||||
let mut cache = state.clipboard_cache.write().await;
|
||||
if let Some(ref prev) = cache.last_text
|
||||
&& prev.text == cached.text {
|
||||
return;
|
||||
}
|
||||
&& prev.text == cached.text
|
||||
{
|
||||
return;
|
||||
}
|
||||
cache.last_text = Some(cached.clone());
|
||||
cache
|
||||
.history
|
||||
@@ -891,12 +892,10 @@ impl McpTool for ClipboardHandler {
|
||||
}
|
||||
|
||||
if let Some(eng) = engine
|
||||
&& let Some(ocr_text) = perform_ocrs_ocr(eng, &dynamic_img) {
|
||||
out.insert(
|
||||
"image_analysis".to_string(),
|
||||
json!(ocr_text.trim()),
|
||||
);
|
||||
}
|
||||
&& let Some(ocr_text) = perform_ocrs_ocr(eng, &dynamic_img)
|
||||
{
|
||||
out.insert("image_analysis".to_string(), json!(ocr_text.trim()));
|
||||
}
|
||||
}
|
||||
Ok(out)
|
||||
},
|
||||
@@ -905,9 +904,7 @@ impl McpTool for ClipboardHandler {
|
||||
.map_err(|e| crate::error::AppError::Internal(format!("Task panic: {}", e)))??;
|
||||
|
||||
state.record_activity("clipboard", "Read contents from OS clipboard", None);
|
||||
Ok::<String, crate::error::AppError>(serde_yaml::to_string(&Value::Object(
|
||||
out,
|
||||
))?)
|
||||
Ok::<String, crate::error::AppError>(serde_yaml::to_string(&Value::Object(out))?)
|
||||
}
|
||||
ClipboardAction::Write => {
|
||||
let text_opt = req.text;
|
||||
|
||||
Reference in new issue
Block a user