recycleactor commited on
Commit
771d2ee
·
verified ·
1 Parent(s): 2905dc1

Upload 2 files

Browse files
Files changed (1) hide show
  1. src/api.rs +9 -2
src/api.rs CHANGED
@@ -60,8 +60,15 @@ pub struct APIClient {
60
 
61
  impl APIClient {
62
  pub fn new() -> Self {
63
- let arl = env::var("ARL").expect("ARL environment variable required");
64
- Self::new_with_arl(arl)
 
 
 
 
 
 
 
65
  }
66
 
67
  pub fn new_with_arl(arl: String) -> Self {
 
60
 
61
  impl APIClient {
62
  pub fn new() -> Self {
63
+ match env::var("ARL") {
64
+ Ok(arl) if !arl.trim().is_empty() => Self::new_with_arl(arl),
65
+ _ => Self {
66
+ client: Client::builder().build().unwrap(),
67
+ license_token: String::new(),
68
+ check_form: String::new(),
69
+ renew_instant: None,
70
+ },
71
+ }
72
  }
73
 
74
  pub fn new_with_arl(arl: String) -> Self {