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,16 +17,16 @@ 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);
|
||||
|
||||
let log_file = format!("{}/rf2_vk_hud.log", home);
|
||||
|
||||
if let Ok(mut file) = std::fs::OpenOptions::new()
|
||||
.append(true)
|
||||
.create(true)
|
||||
.open(&log_file)
|
||||
{
|
||||
if let Err(_) = file.write_all(format!("{}\n", msg.to_string()).as_bytes()) {}
|
||||
if let Ok(mut file) = std::fs::OpenOptions::new()
|
||||
.append(true)
|
||||
.create(true)
|
||||
.open(&log_file)
|
||||
{
|
||||
if let Err(_) = file.write_all(format!("{}\n", msg.to_string()).as_bytes()) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue