From c6d3203cf5381ceb1d03e44ce8f60cd8a795161d Mon Sep 17 00:00:00 2001 From: Daniel Edrisian Date: Mon, 25 Aug 2025 09:46:32 -0700 Subject: [PATCH] Fixes + clippy --- codex-rs/tui/src/bottom_pane/chat_composer.rs | 4 ++-- codex-rs/tui/src/bottom_pane/string_utils.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index 8be594531c..11b0a01e66 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -1693,7 +1693,7 @@ mod tests { "one image mapping remains" ); } - + #[test] fn pasting_filepath_attaches_image() { use image::ImageBuffer; @@ -1706,7 +1706,7 @@ mod tests { ImageBuffer::from_fn(3, 2, |_x, _y| Rgba([1, 2, 3, 255])); img.save(&tmp_path).expect("failed to write temp png"); - let (tx, _rx) = std::sync::mpsc::channel(); + let (tx, _rx) = unbounded_channel::(); let sender = AppEventSender::new(tx); let mut composer = ChatComposer::new(true, sender, false, "Ask Codex to do anything".to_string()); diff --git a/codex-rs/tui/src/bottom_pane/string_utils.rs b/codex-rs/tui/src/bottom_pane/string_utils.rs index 63fb1541a4..422defbc84 100644 --- a/codex-rs/tui/src/bottom_pane/string_utils.rs +++ b/codex-rs/tui/src/bottom_pane/string_utils.rs @@ -2,11 +2,10 @@ use std::path::PathBuf; pub fn normalize_pasted_path(pasted: &str) -> Option { // file:// URL → filesystem path - if let Ok(url) = url::Url::parse(pasted) { - if url.scheme() == "file" { + if let Ok(url) = url::Url::parse(pasted) + && url.scheme() == "file" { return url.to_file_path().ok(); } - } // shell-escaped single path → unescaped let parts: Vec = shlex::Shlex::new(pasted).collect();