mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-11 11:01:27 +03:00
remove many unwrap and enum_value_or_default
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -12,15 +12,14 @@ fn main() {
|
||||
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",
|
||||
gen_name(&License {
|
||||
key: args[0].clone(),
|
||||
host: args[1].clone(),
|
||||
api,
|
||||
})
|
||||
.unwrap()
|
||||
);
|
||||
match gen_name(&License {
|
||||
key: args[0].clone(),
|
||||
host: args[1].clone(),
|
||||
api,
|
||||
}) {
|
||||
Ok(name) => println!("rustdesk-licensed-{}.exe", name),
|
||||
Err(e) => println!("{:?}", e),
|
||||
}
|
||||
}
|
||||
if args.len() == 1 {
|
||||
println!("{:?}", get_license_from_string(&args[0]));
|
||||
|
||||
Reference in New Issue
Block a user