From 4c48f3992b07a649da31e90fdc3759d7ecd21089 Mon Sep 17 00:00:00 2001 From: Daniel Edrisian Date: Wed, 20 Aug 2025 15:33:54 -0700 Subject: [PATCH] fix warnings? --- codex-rs/tui/src/clipboard_paste.rs | 3 ++- codex-rs/tui/src/string_utils.rs | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/codex-rs/tui/src/clipboard_paste.rs b/codex-rs/tui/src/clipboard_paste.rs index 365ad390c0..1b752ca76b 100644 --- a/codex-rs/tui/src/clipboard_paste.rs +++ b/codex-rs/tui/src/clipboard_paste.rs @@ -24,7 +24,8 @@ impl std::error::Error for PasteImageError {} pub struct PastedImageInfo { pub width: u32, pub height: u32, - pub encoded_format_label: &'static str, // Always PNG for now. + #[allow(dead_code)] + pub encoded_format_label: &'static str, // Used in tests; always "PNG" currently. } /// Capture image from system clipboard, encode to PNG, and return bytes + info. diff --git a/codex-rs/tui/src/string_utils.rs b/codex-rs/tui/src/string_utils.rs index 73a82c4ce7..69c7e84d79 100644 --- a/codex-rs/tui/src/string_utils.rs +++ b/codex-rs/tui/src/string_utils.rs @@ -35,9 +35,7 @@ pub(crate) fn percent_decode_to_string(input: &str) -> Option { // - On Unix, require absolute paths (leading '/'). // - On Windows, support forms like file:///C:/path and file://localhost/C:/path. pub(crate) fn file_url_to_path(s: &str) -> Option { - let Some(mut rest) = s.strip_prefix("file://") else { - return None; - }; + let mut rest = s.strip_prefix("file://")?; // Handle optional host (e.g., file://localhost/...). Only allow empty or localhost. if let Some(after_host) = rest.strip_prefix("localhost") {