Skip to content

Commit 70f5a82

Browse files
committed
using compile time environmental variable instead of runtime var, updating .gitignore file
1 parent 0433180 commit 70f5a82

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ src/app/data.rs
1010
/.cargo-packager
1111
Cargo.lock
1212
*.db.old
13-
*.toml
14-
set_env.sh
13+
telescope.toml

src/app.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ impl Default for TelescopeApp {
7373
let app_data = AppData::new();
7474
let esi = webb::esi::EsiManager::new(
7575
app_data.user_agent.as_str(),
76-
app_data.client_id.as_str(),
77-
app_data.secret_key.as_str(),
76+
app_data.client_id,
77+
app_data.secret_key,
7878
app_data.url.as_str(),
7979
app_data.scope,
8080
settings.paths.local_db.clone(),

src/app/data.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pub struct AppData<'a> {
22
pub user_agent: String,
33
pub scope: Vec<&'a str>,
4-
pub secret_key: String,
5-
pub client_id: String,
4+
pub secret_key: &'a str,
5+
pub client_id: &'a str,
66
pub url: String,
77
}
88

@@ -19,8 +19,8 @@ impl<'a> AppData<'a> {
1919
"esi-corporations.read_standings.v1",
2020
"esi-alliances.read_contacts.v1",
2121
],
22-
secret_key: std::env::var("TELESCOPE_SECRET_KEY").expect("No ESI Secret Key its configured"),
23-
client_id: std::env::var("TELESCOPE_CLIENT_ID").expect("No ESI Client Id its configured"),
22+
secret_key: env!("TELESCOPE_SECRET_KEY"),
23+
client_id: env!("TELESCOPE_CLIENT_ID"),
2424
url: String::from("http://localhost:56123/login"),
2525
user_agent: String::from("telescope/dev"),
2626
}

0 commit comments

Comments
 (0)