Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
trumank committed Aug 18, 2023
1 parent dc6b06f commit bd803ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 107 deletions.
99 changes: 0 additions & 99 deletions hook/Cargo.lock

This file was deleted.

21 changes: 13 additions & 8 deletions hook/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,19 @@ impl<T> TArray<T> {

impl FString {
fn to_os_string(&self) -> OsString {
use std::os::windows::ffi::OsStringExt;
let slice = self.as_slice();
let len = slice
.iter()
.enumerate()
.find_map(|(i, &b)| (b == 0).then_some(i))
.unwrap_or(slice.len());
std::ffi::OsString::from_wide(&slice[0..len])
#[cfg(target_os = "windows")]
{
use std::os::windows::ffi::OsStringExt;
let slice = self.as_slice();
let len = slice
.iter()
.enumerate()
.find_map(|(i, &b)| (b == 0).then_some(i))
.unwrap_or(slice.len());
std::ffi::OsString::from_wide(&slice[0..len])
}
#[cfg(not(target_os = "windows"))]
unimplemented!()
}
}

Expand Down

0 comments on commit bd803ea

Please sign in to comment.