From 186b5b463f6acb86d2c8cb788d7df87a6850ed0d Mon Sep 17 00:00:00 2001 From: huqiantao Date: Sun, 7 Jun 2026 19:44:25 +0800 Subject: [PATCH] style: apply cargo fmt formatting to tools/file.rs --- crates/tui/src/tools/file.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/tui/src/tools/file.rs b/crates/tui/src/tools/file.rs index 3600c933..27dd2741 100644 --- a/crates/tui/src/tools/file.rs +++ b/crates/tui/src/tools/file.rs @@ -115,7 +115,9 @@ impl ToolSpec for ReadFileTool { )); } Some(v) => usize::try_from(v).map_err(|_| { - ToolError::invalid_input("start_line exceeds platform addressable range".to_string()) + ToolError::invalid_input( + "start_line exceeds platform addressable range".to_string(), + ) })?, None => 1, }; @@ -301,9 +303,9 @@ fn clean_pdf_text(raw: &str) -> String { if any_content { let start = out.find(|c: char| c != '\n').unwrap_or(0); // Walk back from end to find the last non-newline character. - let end = out - .rfind(|c: char| c != '\n') - .map_or(out.len(), |i| i + out[i..].chars().next().map_or(1, |c| c.len_utf8())); + let end = out.rfind(|c: char| c != '\n').map_or(out.len(), |i| { + i + out[i..].chars().next().map_or(1, |c| c.len_utf8()) + }); out[start..end].to_string() } else { String::new()