fix constant declaration duplication

This commit is contained in:
pierre
2023-07-21 14:49:41 +02:00
parent 03ef5254cc
commit 649e763732
4 changed files with 8 additions and 5 deletions
+3 -2
View File
@@ -1,7 +1,8 @@
use std::env;
const SENTRY_DSN_RUST: &str = "SENTRY_DSN_RUST";
const SENTRY_DSN_JS: &str = "SENTRY_DSN_JS";
mod constants;
use constants::{SENTRY_DSN_JS, SENTRY_DSN_RUST};
fn main() {
// set these env vars at compile time
@@ -0,0 +1,3 @@
// env var keys
pub const SENTRY_DSN_RUST: &str = "SENTRY_DSN_RUST";
pub const SENTRY_DSN_JS: &str = "SENTRY_DSN_JS";
@@ -16,6 +16,7 @@ use crate::state::State;
use crate::window::window_toggle;
mod config;
mod constants;
mod error;
mod events;
mod logging;
@@ -3,9 +3,7 @@ use std::env;
use anyhow::{Context, Result};
use sentry::ClientInitGuard;
// env var keys
const SENTRY_DSN_RUST: &str = "SENTRY_DSN_RUST";
const SENTRY_DSN_JS: &str = "SENTRY_DSN_JS";
use crate::constants::{SENTRY_DSN_JS, SENTRY_DSN_RUST};
pub fn init() -> Result<ClientInitGuard> {
// if these env vars were set at compile time, use their value