Skip to content

Commit bc82955

Browse files
committed
Replace dotenv with well-maintained dotenvy crate
1 parent e4d069b commit bc82955

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ edition = "2021"
99
[dependencies]
1010
serde_json = "1"
1111
openssl = "0.10"
12-
dotenv = "0.15"
12+
dotenvy = "0.15"
1313
reqwest = { version = "0.11.4", features = ["json", "blocking"] }
1414
regex = "1"
1515
anyhow = "1"

src/bin/compiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use triagebot::agenda;
22

33
#[tokio::main(flavor = "current_thread")]
44
async fn main() -> anyhow::Result<()> {
5-
dotenv::dotenv().ok();
5+
dotenvy::dotenv().ok();
66
tracing_subscriber::fmt::init();
77

88
let args: Vec<String> = std::env::args().collect();

src/bin/lang.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use triagebot::agenda;
22

33
#[tokio::main(flavor = "current_thread")]
44
async fn main() -> anyhow::Result<()> {
5-
dotenv::dotenv().ok();
5+
dotenvy::dotenv().ok();
66
tracing_subscriber::fmt::init();
77

88
let args: Vec<String> = std::env::args().collect();

src/bin/prioritization-agenda.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use triagebot::agenda;
22

33
#[tokio::main(flavor = "current_thread")]
44
async fn main() -> anyhow::Result<()> {
5-
dotenv::dotenv().ok();
5+
dotenvy::dotenv().ok();
66
tracing_subscriber::fmt::init();
77

88
let agenda = agenda::prioritization();

src/bin/project_goals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct Opt {
1717

1818
#[tokio::main(flavor = "current_thread")]
1919
async fn main() -> anyhow::Result<()> {
20-
dotenv::dotenv().ok();
20+
dotenvy::dotenv().ok();
2121
tracing_subscriber::fmt::init();
2222

2323
let opt = Opt::from_args();

src/bin/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use triagebot::agenda;
22

33
#[tokio::main(flavor = "current_thread")]
44
async fn main() -> anyhow::Result<()> {
5-
dotenv::dotenv().ok();
5+
dotenvy::dotenv().ok();
66
tracing_subscriber::fmt::init();
77

88
let args: Vec<String> = std::env::args().collect();

src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ fn is_scheduled_jobs_disabled() -> bool {
428428
}
429429

430430
#[tokio::main(flavor = "current_thread")]
431-
async fn main() {
432-
dotenv::dotenv().ok();
431+
async fn main() -> anyhow::Result<()> {
432+
dotenvy::dotenv().ok();
433433
tracing_subscriber::fmt::Subscriber::builder()
434434
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
435435
.with_ansi(std::env::var_os("DISABLE_COLOR").is_none())
@@ -441,7 +441,6 @@ async fn main() {
441441
.map(|p| p.parse::<u16>().expect("parsed PORT"))
442442
.unwrap_or(8000);
443443
let addr = ([0, 0, 0, 0], port).into();
444-
if let Err(e) = run_server(addr).await {
445-
eprintln!("Failed to run server: {:?}", e);
446-
}
444+
run_server(addr).await.context("Failed to run the server")?;
445+
Ok(())
447446
}

0 commit comments

Comments
 (0)