mirror of
https://github.com/openai/codex.git
synced 2026-09-13 11:47:17 +00:00
Fixes + clippy
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user