Skip to content

Commit

Permalink
fix warning on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Feb 3, 2025
1 parent 13eecc8 commit 1086ca2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/webserver/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::{file_cache::FileCache, AppState};
use awc::http::uri::PathAndQuery;
use log::debug;
use percent_encoding;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use RoutingAction::{CustomNotFound, Execute, NotFound, Redirect, Serve};

Expand Down Expand Up @@ -94,7 +93,9 @@ where
let decoded = percent_encoding::percent_decode_str(path);
#[cfg(unix)]
{
use std::ffi::OsString;
use std::os::unix::ffi::OsStringExt;

let decoded = decoded.collect::<Vec<u8>>();
Ok(PathBuf::from(OsString::from_vec(decoded)))
}
Expand Down

0 comments on commit 1086ca2

Please sign in to comment.