Merge pull request #3876 from Grelo4ka/naming

Improve naming.rs
This commit is contained in:
RustDesk 2023-04-01 10:58:39 +08:00 committed by GitHub
commit 0718f00eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,26 +4,13 @@ use hbb_common::ResultType;
use license::*;
fn gen_name(lic: &License) -> ResultType<String> {
let tmp = serde_json::to_vec::<License>(lic)?;
let tmp = URL_SAFE_NO_PAD.encode(&tmp);
let tmp: String = tmp.chars().rev().collect();
Ok(tmp)
let tmp = URL_SAFE_NO_PAD.encode(&serde_json::to_vec(lic)?);
Ok(tmp.chars().rev().collect())
}
fn main() {
let mut args = Vec::new();
let mut i = 0;
for arg in std::env::args() {
if i > 0 {
args.push(arg);
}
i += 1;
}
let api = if args.len() < 3 {
"".to_owned()
} else {
args[2].clone()
};
let args: Vec<_> = std::env::args().skip(1).collect();
let api = args.get(2).cloned().unwrap_or_default();
if args.len() >= 2 {
println!(
"rustdesk-licensed-{}.exe",