Fixes + clippy

This commit is contained in:
Daniel Edrisian
2025-08-25 09:46:32 -07:00
parent edf2402b95
commit c6d3203cf5
2 changed files with 4 additions and 5 deletions

View File

@@ -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::<AppEvent>();
let sender = AppEventSender::new(tx);
let mut composer =
ChatComposer::new(true, sender, false, "Ask Codex to do anything".to_string());

View File

@@ -2,11 +2,10 @@ use std::path::PathBuf;
pub fn normalize_pasted_path(pasted: &str) -> Option<PathBuf> {
// 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<String> = shlex::Shlex::new(pasted).collect();