Don't unwrap in debug code
This commit is contained in:
parent
872c858f9e
commit
b4d6644c48
1 changed files with 9 additions and 9 deletions
|
@ -17,8 +17,7 @@ macro_rules! load_function_ptrs {
|
|||
fn log(msg: impl ToString) {
|
||||
use std::io::Write;
|
||||
|
||||
let home = std::env::var("HOME").unwrap();
|
||||
|
||||
if let Ok(home) = std::env::var("HOME") {
|
||||
let log_file = format!("{}/rf2_vk_hud.log", home);
|
||||
|
||||
if let Ok(mut file) = std::fs::OpenOptions::new()
|
||||
|
@ -29,6 +28,7 @@ macro_rules! load_function_ptrs {
|
|||
if let Err(_) = file.write_all(format!("{}\n", msg.to_string()).as_bytes()) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load<F>(mut f: F) -> $struct_name
|
||||
where F: FnMut(&std::ffi::CStr) -> *const std::os::raw::c_void
|
||||
|
|
Loading…
Reference in a new issue