summaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-01-22 15:31:52 -0600
committerLibravatar bigfoot547 <[email protected]>2025-01-22 15:31:52 -0600
commit08dba4588e93ce338cf01d740bf0923a4f46ade8 (patch)
treef8888fe3eed524330e247669a516b0b206f375ec /src/util.rs
parentwip: jre download stuff (diff)
more jre download stuff
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs
index b7b7c6d..8ad3632 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -68,7 +68,7 @@ pub async fn verify_file(path: impl AsRef<Path>, expect_size: Option<usize>, exp
let path = path.as_ref();
if expect_size.is_none() && expect_sha1.is_none() {
- return match path.metadata() {
+ return match fs::metadata(path).await {
Ok(_) => {
debug!("No size or sha1 for {}, have to assume it's good.", path.display());
Ok(())
@@ -257,6 +257,9 @@ pub fn strip_verbatim(path: &Path) -> &Path {
return path;
};
+ use std::path::Prefix;
+ use std::ffi::OsStr;
+
match p.kind() {
Prefix::VerbatimDisk(_) =>
Path::new(unsafe { OsStr::from_encoded_bytes_unchecked(&path.as_os_str().as_encoded_bytes()[4..]) }),
@@ -283,6 +286,7 @@ impl AsJavaPath for Path {
mod tests {
#[allow(unused_imports)]
use super::*;
+ use std::path::Prefix;
#[test]
#[cfg(windows)]