it does indeed work on windows

This commit is contained in:
Lynne Megido 2021-02-27 12:24:51 +10:00
parent ebc2bcfb41
commit 52a0709097
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
3 changed files with 2 additions and 3 deletions

View File

@ -48,7 +48,7 @@ fn smart_write<W: Write>(f: &mut W, writeables: &[Writable]) -> io::Result<()> {
f.write_all(&*path.as_os_str().as_bytes())?;
#[cfg(windows)]
write!(f, "{}", path.as_os_str().to_string_lossy())?; // TODO: implement bonked strings for windows
// f.write_all(&*path.as_os_str().encode_wide().collect::<Vec<u16>>())?;
// f.write_all(&*path.as_os_str().encode_wide().collect::<Vec<u16>>())?;
write!(f, "'''")?
}
}

View File

@ -50,7 +50,6 @@ cfg_if! {
}
cfg_if! {
// TODO: test if this actually works on a windows machine
if #[cfg(windows)] {
fn is_hidden(entry: &DirEntry) -> bool {
use std::os::windows::prelude::*;

View File

@ -92,7 +92,7 @@ cfg_if! {
}
fn get_type(&self, data: &[u8]) -> Option<Mime> {
self.db.get_mime_type_for_data(&data).map(|m| m.0)
self.db.get_mime_type_for_data(data).map(|m| m.0)
}
}
}