projects
/
rup.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleaning
[rup.git]
/
src
/
main.rs
diff --git
a/src/main.rs
b/src/main.rs
index
6ecbb0a
..
f1e66ee
100644
(file)
--- a/
src/main.rs
+++ b/
src/main.rs
@@
-53,10
+53,10
@@
struct Config {
fn get_exe_name() -> String {
let first_arg = std::env::args().nth(0).unwrap();
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()
}
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)
fn read_key() -> String {
let mut key = String::new();
File::open(consts::FILE_KEY)
@@
-65,7
+65,7
@@
fn read_key() -> String {
.expect(&format!("Failed to read key file: {}", consts::FILE_KEY));
String::from(
.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))
)
.decode_utf8()
.expect(&format!("Failed to decode key file: {}", consts::FILE_KEY))
)