fix warnings?

This commit is contained in:
Daniel Edrisian
2025-08-20 15:33:54 -07:00
parent 1b0ef70b53
commit 4c48f3992b
2 changed files with 3 additions and 4 deletions

View File

@@ -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.

View File

@@ -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") {