From 0de7b5e76a4487933b60acf811e1d8916b6ff1d0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 00:27:58 +0000 Subject: [PATCH 1/2] fix: apply cargo clippy fixes Auto-fixed by cargo clippy --fix: - Simplify nested if-let chains in tiptap/validate.rs - Remove unnecessary .to_string() in api/main.rs - Collapse nested if blocks in deeplink2/server/mod.rs Manually fixed: - Box large enum variant EnhanceUser in template-app to fix large_enum_variant warning Co-Authored-By: bot_apk --- apps/api/src/main.rs | 2 +- crates/template-app/src/lib.rs | 4 +-- crates/tiptap/src/validate.rs | 45 ++++++++++++----------------- plugins/deeplink2/src/server/mod.rs | 11 +++++-- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/apps/api/src/main.rs b/apps/api/src/main.rs index 3552a8d023..60dd3080a1 100644 --- a/apps/api/src/main.rs +++ b/apps/api/src/main.rs @@ -28,7 +28,7 @@ pub const DEVICE_FINGERPRINT_HEADER: &str = "x-device-fingerprint"; async fn app() -> Router { let env = env(); - let analytics = build_analytics_client(&env); + let analytics = build_analytics_client(env); let llm_config = hypr_llm_proxy::LlmProxyConfig::new(&env.llm).with_analytics(analytics.clone()); diff --git a/crates/template-app/src/lib.rs b/crates/template-app/src/lib.rs index e01436da13..cd6b7cd207 100644 --- a/crates/template-app/src/lib.rs +++ b/crates/template-app/src/lib.rs @@ -24,7 +24,7 @@ macro_rules! common_derives { common_derives! { pub enum Template { EnhanceSystem(EnhanceSystem), - EnhanceUser(EnhanceUser), + EnhanceUser(Box), TitleSystem(TitleSystem), TitleUser(TitleUser), ChatSystem(ChatSystem), @@ -46,7 +46,7 @@ pub enum Error { pub fn render(t: Template) -> Result { let value = match t { Template::EnhanceSystem(t) => askama::Template::render(&t), - Template::EnhanceUser(t) => askama::Template::render(&t), + Template::EnhanceUser(t) => askama::Template::render(&*t), Template::TitleSystem(t) => askama::Template::render(&t), Template::TitleUser(t) => askama::Template::render(&t), Template::ChatSystem(t) => askama::Template::render(&t), diff --git a/crates/tiptap/src/validate.rs b/crates/tiptap/src/validate.rs index e0a4b9cf2a..76a03664c8 100644 --- a/crates/tiptap/src/validate.rs +++ b/crates/tiptap/src/validate.rs @@ -70,14 +70,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { } for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if !is_block_type(ct) { + if let Some(ct) = node_type(child) + && !is_block_type(ct) { errors.push(ValidationError { path: child_path.clone(), message: format!("doc child must be a block node, got '{ct}'"), }); } - } validate_node(child, &child_path, errors); } } @@ -85,28 +84,26 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { "paragraph" => { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if !is_inline_type(ct) { + if let Some(ct) = node_type(child) + && !is_inline_type(ct) { errors.push(ValidationError { path: child_path.clone(), message: format!("paragraph child must be an inline node, got '{ct}'"), }); } - } } } "heading" => { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if !is_inline_type(ct) { + if let Some(ct) = node_type(child) + && !is_inline_type(ct) { errors.push(ValidationError { path: child_path.clone(), message: format!("heading child must be an inline node, got '{ct}'"), }); } - } } } @@ -120,14 +117,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { } for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if ct != "listItem" { + if let Some(ct) = node_type(child) + && ct != "listItem" { errors.push(ValidationError { path: child_path.clone(), message: format!("bulletList child must be 'listItem', got '{ct}'"), }); } - } validate_node(child, &child_path, errors); } } @@ -143,14 +139,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { } for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if ct != "listItem" { + if let Some(ct) = node_type(child) + && ct != "listItem" { errors.push(ValidationError { path: child_path.clone(), message: format!("orderedList child must be 'listItem', got '{ct}'"), }); } - } validate_node(child, &child_path, errors); } } @@ -165,14 +160,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { } for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if ct != "taskItem" { + if let Some(ct) = node_type(child) + && ct != "taskItem" { errors.push(ValidationError { path: child_path.clone(), message: format!("taskList child must be 'taskItem', got '{ct}'"), }); } - } validate_node(child, &child_path, errors); } } @@ -198,14 +192,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { } for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if !is_block_type(ct) { + if let Some(ct) = node_type(child) + && !is_block_type(ct) { errors.push(ValidationError { path: child_path.clone(), message: format!("{typ} child must be a block node, got '{ct}'"), }); } - } validate_node(child, &child_path, errors); } } @@ -221,14 +214,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { } for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if !is_block_type(ct) { + if let Some(ct) = node_type(child) + && !is_block_type(ct) { errors.push(ValidationError { path: child_path.clone(), message: format!("blockquote child must be a block node, got '{ct}'"), }); } - } validate_node(child, &child_path, errors); } } @@ -236,14 +228,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { "codeBlock" => { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); - if let Some(ct) = node_type(child) { - if ct != "text" { + if let Some(ct) = node_type(child) + && ct != "text" { errors.push(ValidationError { path: child_path, message: format!("codeBlock child must be 'text', got '{ct}'"), }); } - } } } diff --git a/plugins/deeplink2/src/server/mod.rs b/plugins/deeplink2/src/server/mod.rs index 353cc229d6..9cff301f84 100644 --- a/plugins/deeplink2/src/server/mod.rs +++ b/plugins/deeplink2/src/server/mod.rs @@ -33,6 +33,12 @@ pub struct CallbackServerState { active_port: Mutex>, } +impl Default for CallbackServerState { + fn default() -> Self { + Self::new() + } +} + impl CallbackServerState { pub fn new() -> Self { Self { @@ -196,11 +202,10 @@ async fn serve( if let Ok(mut servers) = state.servers.lock() { servers.remove(&port); } - if let Ok(mut active) = state.active_port.lock() { - if *active == Some(port) { + if let Ok(mut active) = state.active_port.lock() + && *active == Some(port) { *active = None; } - } } pub async fn start( From bb7600b30ab5c7ddf8299863cd159f39ccc2acd6 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 00:35:23 +0000 Subject: [PATCH 2/2] style: apply dprint formatting to clippy-fixed files Co-Authored-By: bot_apk --- crates/tiptap/src/validate.rs | 117 +++++++++++++++------------- plugins/deeplink2/src/server/mod.rs | 7 +- 2 files changed, 67 insertions(+), 57 deletions(-) diff --git a/crates/tiptap/src/validate.rs b/crates/tiptap/src/validate.rs index 76a03664c8..f7c7d20449 100644 --- a/crates/tiptap/src/validate.rs +++ b/crates/tiptap/src/validate.rs @@ -71,12 +71,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && !is_block_type(ct) { - errors.push(ValidationError { - path: child_path.clone(), - message: format!("doc child must be a block node, got '{ct}'"), - }); - } + && !is_block_type(ct) + { + errors.push(ValidationError { + path: child_path.clone(), + message: format!("doc child must be a block node, got '{ct}'"), + }); + } validate_node(child, &child_path, errors); } } @@ -85,12 +86,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && !is_inline_type(ct) { - errors.push(ValidationError { - path: child_path.clone(), - message: format!("paragraph child must be an inline node, got '{ct}'"), - }); - } + && !is_inline_type(ct) + { + errors.push(ValidationError { + path: child_path.clone(), + message: format!("paragraph child must be an inline node, got '{ct}'"), + }); + } } } @@ -98,12 +100,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && !is_inline_type(ct) { - errors.push(ValidationError { - path: child_path.clone(), - message: format!("heading child must be an inline node, got '{ct}'"), - }); - } + && !is_inline_type(ct) + { + errors.push(ValidationError { + path: child_path.clone(), + message: format!("heading child must be an inline node, got '{ct}'"), + }); + } } } @@ -118,12 +121,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && ct != "listItem" { - errors.push(ValidationError { - path: child_path.clone(), - message: format!("bulletList child must be 'listItem', got '{ct}'"), - }); - } + && ct != "listItem" + { + errors.push(ValidationError { + path: child_path.clone(), + message: format!("bulletList child must be 'listItem', got '{ct}'"), + }); + } validate_node(child, &child_path, errors); } } @@ -140,12 +144,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && ct != "listItem" { - errors.push(ValidationError { - path: child_path.clone(), - message: format!("orderedList child must be 'listItem', got '{ct}'"), - }); - } + && ct != "listItem" + { + errors.push(ValidationError { + path: child_path.clone(), + message: format!("orderedList child must be 'listItem', got '{ct}'"), + }); + } validate_node(child, &child_path, errors); } } @@ -161,12 +166,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && ct != "taskItem" { - errors.push(ValidationError { - path: child_path.clone(), - message: format!("taskList child must be 'taskItem', got '{ct}'"), - }); - } + && ct != "taskItem" + { + errors.push(ValidationError { + path: child_path.clone(), + message: format!("taskList child must be 'taskItem', got '{ct}'"), + }); + } validate_node(child, &child_path, errors); } } @@ -193,12 +199,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && !is_block_type(ct) { - errors.push(ValidationError { - path: child_path.clone(), - message: format!("{typ} child must be a block node, got '{ct}'"), - }); - } + && !is_block_type(ct) + { + errors.push(ValidationError { + path: child_path.clone(), + message: format!("{typ} child must be a block node, got '{ct}'"), + }); + } validate_node(child, &child_path, errors); } } @@ -215,12 +222,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && !is_block_type(ct) { - errors.push(ValidationError { - path: child_path.clone(), - message: format!("blockquote child must be a block node, got '{ct}'"), - }); - } + && !is_block_type(ct) + { + errors.push(ValidationError { + path: child_path.clone(), + message: format!("blockquote child must be a block node, got '{ct}'"), + }); + } validate_node(child, &child_path, errors); } } @@ -229,12 +237,13 @@ fn validate_node(node: &Value, path: &str, errors: &mut Vec) { for (i, child) in content.iter().enumerate() { let child_path = format!("{path}.content[{i}]"); if let Some(ct) = node_type(child) - && ct != "text" { - errors.push(ValidationError { - path: child_path, - message: format!("codeBlock child must be 'text', got '{ct}'"), - }); - } + && ct != "text" + { + errors.push(ValidationError { + path: child_path, + message: format!("codeBlock child must be 'text', got '{ct}'"), + }); + } } } diff --git a/plugins/deeplink2/src/server/mod.rs b/plugins/deeplink2/src/server/mod.rs index 9cff301f84..6a7747ce93 100644 --- a/plugins/deeplink2/src/server/mod.rs +++ b/plugins/deeplink2/src/server/mod.rs @@ -203,9 +203,10 @@ async fn serve( servers.remove(&port); } if let Ok(mut active) = state.active_port.lock() - && *active == Some(port) { - *active = None; - } + && *active == Some(port) + { + *active = None; + } } pub async fn start(