mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +03:00
fix warnings?
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -35,9 +35,7 @@ pub(crate) fn percent_decode_to_string(input: &str) -> Option<String> {
|
||||
// - 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<std::path::PathBuf> {
|
||||
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") {
|
||||
|
||||
Reference in New Issue
Block a user