fn get_exe_name() -> String {
let first_arg = std::env::args().nth(0).unwrap();
- //dbg!(&first_arg);
let sep: &[_] = &['\\', '/'];
first_arg[first_arg.rfind(sep).unwrap()+1..].to_string()
}
+
fn read_key() -> String {
let mut key = String::new();
File::open(consts::FILE_KEY)
.expect(&format!("Failed to read key file: {}", consts::FILE_KEY));
String::from(
- percent_encoding::percent_decode(key.as_bytes())
+ percent_encoding::percent_decode(key.replace('\n', "").as_bytes())
.decode_utf8()
.expect(&format!("Failed to decode key file: {}", consts::FILE_KEY))
)